@tryghost/job-manager 0.8.10 → 0.8.14
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/job-manager.js +2 -5
- package/package.json +7 -7
package/lib/job-manager.js
CHANGED
|
@@ -3,7 +3,7 @@ const fastq = require('fastq');
|
|
|
3
3
|
const later = require('@breejs/later');
|
|
4
4
|
const Bree = require('bree');
|
|
5
5
|
const pWaitFor = require('p-wait-for');
|
|
6
|
-
const {
|
|
6
|
+
const {UnhandledJobError, IncorrectUsageError} = require('@tryghost/errors');
|
|
7
7
|
const isCronExpression = require('./is-cron-expression');
|
|
8
8
|
const assembleBreeJob = require('./assemble-bree-job');
|
|
9
9
|
|
|
@@ -109,10 +109,7 @@ class JobManager {
|
|
|
109
109
|
} catch (err) {
|
|
110
110
|
// NOTE: each job should be written in a safe way and handle all errors internally
|
|
111
111
|
// if the error is caught here jobs implementaton should be changed
|
|
112
|
-
this.logging.error(new
|
|
113
|
-
level: 'critical',
|
|
114
|
-
errorType: 'UnhandledJobError',
|
|
115
|
-
message: 'Processed job threw an unhandled error',
|
|
112
|
+
this.logging.error(new UnhandledJobError({
|
|
116
113
|
context: (typeof job === 'function') ? 'function' : job,
|
|
117
114
|
err
|
|
118
115
|
}));
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tryghost/job-manager",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.14",
|
|
4
4
|
"repository": "https://github.com/TryGhost/Utils/tree/main/packages/job-manager",
|
|
5
5
|
"author": "Ghost Foundation",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"dev": "echo \"Implement me!\"",
|
|
10
|
-
"test": "NODE_ENV=testing c8 mocha './test/**/*.test.js'",
|
|
10
|
+
"test": "NODE_ENV=testing c8 --reporter text --reporter cobertura mocha './test/**/*.test.js'",
|
|
11
11
|
"lint": "eslint . --ext .js --cache",
|
|
12
12
|
"posttest": "yarn lint"
|
|
13
13
|
},
|
|
@@ -19,11 +19,11 @@
|
|
|
19
19
|
"access": "public"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@sinonjs/fake-timers": "8.0
|
|
23
|
-
"c8": "7.
|
|
24
|
-
"date-fns": "2.
|
|
22
|
+
"@sinonjs/fake-timers": "8.1.0",
|
|
23
|
+
"c8": "7.10.0",
|
|
24
|
+
"date-fns": "2.26.0",
|
|
25
25
|
"delay": "5.0.0",
|
|
26
|
-
"mocha": "9.1.
|
|
26
|
+
"mocha": "9.1.3",
|
|
27
27
|
"should": "13.2.3",
|
|
28
28
|
"sinon": "11.1.2"
|
|
29
29
|
},
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"fastq": "^1.11.0",
|
|
35
35
|
"p-wait-for": "^3.2.0"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "9cce0db03f9229f7829ad2d0119b4916ca44fc78"
|
|
38
38
|
}
|