ac-bootstrap-bull 1.0.2 → 1.0.3

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.
Files changed (3) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/index.js +11 -6
  3. package/package.json +5 -5
package/CHANGELOG.md CHANGED
@@ -1,3 +1,16 @@
1
+ <a name="1.0.3"></a>
2
+
3
+ ## [1.0.3](https://github.com/admiralcloud/ac-bootstrap-bull/compare/v1.0.2..v1.0.3) (2021-11-27 07:46:38)
4
+
5
+
6
+ ### Bug Fix
7
+
8
+ * **App:** Fixed Redis key, update Redis config, improved function naming | MP | [eafc58717551dc494bb1eae690c7081b44314487](https://github.com/admiralcloud/ac-bootstrap-bull/commit/eafc58717551dc494bb1eae690c7081b44314487)
9
+ Prepare processing is now postProcessing in order to avoid confusion. Redis config is now prepared for Bull 4 (breaking change in Bull), Fixed Redis key
10
+ ### Chores
11
+
12
+ * **App:** Updated packages | MP | [f55e9cd6e0f984fbeb78eaf35fcbb5604c6c5687](https://github.com/admiralcloud/ac-bootstrap-bull/commit/f55e9cd6e0f984fbeb78eaf35fcbb5604c6c5687)
13
+ Updated packages
1
14
  <a name="1.0.2"></a>
2
15
 
3
16
  ## [1.0.2](https://github.com/admiralcloud/ac-bootstrap-bull/compare/v1.0.1..v1.0.2) (2021-10-15 09:45:36)
package/index.js CHANGED
@@ -44,9 +44,11 @@ module.exports = function(acapi) {
44
44
  port,
45
45
  db: _.get(redisConfig, 'db', 3),
46
46
  retryStrategy: (times) => {
47
- const delay = Math.min(times * 1000, 300000)
47
+ const delay = Math.min(Math.pow(2, times) * 1000, 300000)
48
48
  return delay
49
- }
49
+ },
50
+ enableReadyCheck: false,
51
+ maxRetriesPerRequest: null
50
52
  }
51
53
 
52
54
  acapi.aclog.serverInfo(redisConf)
@@ -201,13 +203,13 @@ module.exports = function(acapi) {
201
203
  })
202
204
  }
203
205
 
204
- const prepareProcessing = function(params, cb) {
205
- const functionIdentifier = _.padEnd('prepareProcessing', _.get(acapi.config, 'bull.log.functionIdentifierLength'))
206
+ const postProcesssing = function(params, cb) {
207
+ const functionIdentifier = _.padEnd('postProcesssing', _.get(acapi.config, 'bull.log.functionIdentifierLength'))
206
208
  const jobList = _.get(params, 'jobList')
207
209
  const jobId = _.get(params, 'jobId')
208
210
  const that = this
209
211
 
210
- const redisKey = acapi.config.environment + ':bull:' + _.get(jobList, 'jobList') + ':' + jobId + ':complete:lock'
212
+ const redisKey = acapi.config.environment + ':bull:' + jobList + ':' + jobId + ':complete:lock'
211
213
  const { queueName, jobListConfig } = this.prepareQueue({ jobList, configPath: _.get(params, 'configPath') })
212
214
  if (!queueName) return cb({ message: 'queueNameMissing', additionalInfo: params })
213
215
  const retentionTime = _.get(jobListConfig, 'retentionTime', _.get(acapi.config, 'bull.retentionTime', 60000))
@@ -232,6 +234,8 @@ module.exports = function(acapi) {
232
234
  })
233
235
  })
234
236
  }
237
+ const prepareProcessing = postProcesssing
238
+
235
239
 
236
240
  /**
237
241
  * Shutdown all queues/redis connections
@@ -248,7 +252,8 @@ module.exports = function(acapi) {
248
252
  jobLists,
249
253
  prepareQueue,
250
254
  handleFailedJobs,
251
- prepareProcessing,
255
+ prepareProcessing, // deprecated - please use postProcessing instead
256
+ postProcesssing,
252
257
  addJob,
253
258
  removeJob,
254
259
  shutdown
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "ac-bootstrap-bull",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Bull helper",
5
5
  "repository": "admiralcloud/ac-bootstrap-bull",
6
6
  "author": "Mark Poepping <mark.poepping@admiralcloud.com>",
7
7
  "license": "MIT",
8
8
  "dependencies": {
9
9
  "ac-redislock": "^1.0.11",
10
- "async": "^3.2.1",
11
- "bull": "^3.29.3",
12
- "ioredis": "^4.28.0",
10
+ "async": "^3.2.2",
11
+ "bull": "^4.1.1",
12
+ "ioredis": "^4.28.1",
13
13
  "lodash": "^4.17.21"
14
14
  },
15
15
  "devDependencies": {
16
- "eslint": "^8.0.1"
16
+ "eslint": "^8.3.0"
17
17
  }
18
18
  }