@tryghost/job-manager 2.2.0 → 3.0.0

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/lib/JobManager.js CHANGED
@@ -4,7 +4,6 @@ const setTimeoutPromise = util.promisify(setTimeout);
4
4
  const fastq = require('fastq');
5
5
  const later = require('@breejs/later');
6
6
  const Bree = require('bree');
7
- const pWaitFor = require('p-wait-for');
8
7
  const {UnhandledJobError, IncorrectUsageError} = require('@tryghost/errors');
9
8
  const logging = require('@tryghost/logging');
10
9
  const isCronExpression = require('./is-cron-expression');
@@ -407,7 +406,7 @@ class JobManager {
407
406
  }
408
407
 
409
408
  /**
410
- * @param {import('p-wait-for').Options} [options]
409
+ * @param {object} [options]
411
410
  */
412
411
  async shutdown(options) {
413
412
  await this.bree.stop();
@@ -418,6 +417,7 @@ class JobManager {
418
417
 
419
418
  logging.warn('Waiting for busy job in inline job queue');
420
419
 
420
+ const {default: pWaitFor} = await import('p-wait-for');
421
421
  await pWaitFor(() => this.inlineQueue.idle() === true, options);
422
422
 
423
423
  logging.warn('Inline job queue finished');
@@ -1,4 +1,6 @@
1
- const cronValidate = require('cron-validate');
1
+ const cronValidateModule = require('cron-validate');
2
+ /* c8 ignore next 1 */
3
+ const cronValidate = cronValidateModule.default || cronValidateModule;
2
4
 
3
5
  /**
4
6
  * Checks if expression follows supported crontab format
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tryghost/job-manager",
3
- "version": "2.2.0",
3
+ "version": "3.0.0",
4
4
  "author": "Ghost Foundation",
5
5
  "license": "MIT",
6
6
  "publishConfig": {
@@ -21,21 +21,20 @@
21
21
  ],
22
22
  "devDependencies": {
23
23
  "@sinonjs/fake-timers": "15.1.0",
24
- "c8": "10.1.3",
24
+ "c8": "11.0.0",
25
25
  "date-fns": "4.1.0",
26
- "delay": "5.0.0",
27
26
  "mocha": "11.7.5",
28
27
  "rewire": "9.0.1",
29
28
  "sinon": "21.0.1"
30
29
  },
31
30
  "dependencies": {
32
31
  "@breejs/later": "4.2.0",
33
- "@tryghost/errors": "^2.2.0",
34
- "@tryghost/logging": "^3.2.0",
32
+ "@tryghost/errors": "^3.0.0",
33
+ "@tryghost/logging": "^4.0.0",
35
34
  "bree": "9.2.9",
36
- "cron-validate": "1.4.5",
35
+ "cron-validate": "1.5.3",
37
36
  "fastq": "1.20.1",
38
- "p-wait-for": "3.2.0",
37
+ "p-wait-for": "6.0.0",
39
38
  "workerpool": "10.0.1"
40
39
  },
41
40
  "repository": {