ac-bootstrap-bull 2.0.1 → 2.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/index.js +10 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
<a name="2.0.2"></a>
|
|
2
|
+
|
|
3
|
+
## [2.0.2](https://github.com/admiralcloud/ac-bootstrap-bull/compare/v2.0.1..v2.0.2) (2023-03-12 20:18:16)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fix
|
|
7
|
+
|
|
8
|
+
* **App:** Improved READY logging | MP | [0eefda845de3b7cacf6c15ce20954a09eb6442bd](https://github.com/admiralcloud/ac-bootstrap-bull/commit/0eefda845de3b7cacf6c15ce20954a09eb6442bd)
|
|
9
|
+
Log as silly by default, log as debug if type had an error before.
|
|
10
|
+
Related issues: [undefined/undefined#master](undefined/browse/master)
|
|
1
11
|
<a name="2.0.1"></a>
|
|
2
12
|
|
|
3
13
|
## [2.0.1](https://github.com/admiralcloud/ac-bootstrap-bull/compare/v2.0.0..v2.0.1) (2023-02-20 19:06:02)
|
package/index.js
CHANGED
|
@@ -60,13 +60,22 @@ module.exports = function(acapi) {
|
|
|
60
60
|
|
|
61
61
|
acapi.aclog.serverInfo(redisConf)
|
|
62
62
|
|
|
63
|
+
const errorHistory = {}
|
|
64
|
+
|
|
63
65
|
const createRedisClient = ({ config, type }) => {
|
|
64
66
|
const client = new Redis(config)
|
|
65
67
|
client.on('error', (err) => {
|
|
66
68
|
acapi.log.error('BULL/REDIS | Problem | %s | %s', type.padEnd(25), _.get(err, 'message'))
|
|
69
|
+
// remember error
|
|
70
|
+
_.set(errorHistory, type, _.get(err, 'message'))
|
|
67
71
|
})
|
|
68
72
|
client.on('ready', () => {
|
|
69
|
-
|
|
73
|
+
let level = 'silly'
|
|
74
|
+
if (_.get(errorHistory, type)) {
|
|
75
|
+
level = 'debug' // log after this type had an error
|
|
76
|
+
_.unset(errorHistory, type)
|
|
77
|
+
}
|
|
78
|
+
acapi.log[level]('BULL/REDIS | Ready | %s', type)
|
|
70
79
|
})
|
|
71
80
|
return client
|
|
72
81
|
}
|