@abtnode/queue 1.16.21-beta-420f105a → 1.16.21-beta-93c6e42b
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/index.js +6 -0
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -229,6 +229,11 @@ module.exports = function createQueue({ file, store, onJob, options = {} }) {
|
|
|
229
229
|
return doc ? doc.job : null;
|
|
230
230
|
};
|
|
231
231
|
|
|
232
|
+
const restoreCancelled = async (id) => {
|
|
233
|
+
const doc = await store.updateJob(id, { cancelled: false });
|
|
234
|
+
return doc ? doc.job : null;
|
|
235
|
+
};
|
|
236
|
+
|
|
232
237
|
const getJob = async (id) => {
|
|
233
238
|
const doc = await store.getJob(id);
|
|
234
239
|
return doc ? doc.job : null;
|
|
@@ -310,6 +315,7 @@ module.exports = function createQueue({ file, store, onJob, options = {} }) {
|
|
|
310
315
|
error: (cb) => (queue.error = cb),
|
|
311
316
|
get: getJob,
|
|
312
317
|
cancel,
|
|
318
|
+
restoreCancelled,
|
|
313
319
|
delete: deleteJob,
|
|
314
320
|
options: {
|
|
315
321
|
concurrency,
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.21-beta-
|
|
6
|
+
"version": "1.16.21-beta-93c6e42b",
|
|
7
7
|
"description": "",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -19,13 +19,13 @@
|
|
|
19
19
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
20
20
|
"license": "Apache-2.0",
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@abtnode/db": "1.16.21-beta-
|
|
23
|
-
"@abtnode/util": "1.16.21-beta-
|
|
22
|
+
"@abtnode/db": "1.16.21-beta-93c6e42b",
|
|
23
|
+
"@abtnode/util": "1.16.21-beta-93c6e42b",
|
|
24
24
|
"debug": "^4.3.4",
|
|
25
25
|
"fastq": "^1.13.0",
|
|
26
26
|
"uuid": "^8.3.2"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "80619ce49f5a9224d3d817e5faea4422072b0553",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"jest": "^27.5.1"
|
|
31
31
|
}
|