@abtnode/queue 1.16.29-beta-ec04c755 → 1.16.29-beta-2eaf40bc
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 +8 -2
- package/package.json +4 -4
package/lib/index.js
CHANGED
|
@@ -225,12 +225,18 @@ module.exports = function createQueue({ file, store, onJob, options = {} }) {
|
|
|
225
225
|
};
|
|
226
226
|
|
|
227
227
|
const cancel = async (id) => {
|
|
228
|
-
|
|
228
|
+
let doc = await store.getJob(id);
|
|
229
|
+
if (doc) {
|
|
230
|
+
doc = await store.updateJob(id, { cancelled: true });
|
|
231
|
+
}
|
|
229
232
|
return doc ? doc.job : null;
|
|
230
233
|
};
|
|
231
234
|
|
|
232
235
|
const restoreCancelled = async (id) => {
|
|
233
|
-
|
|
236
|
+
let doc = await store.getJob(id);
|
|
237
|
+
if (doc) {
|
|
238
|
+
doc = await store.updateJob(id, { cancelled: false });
|
|
239
|
+
}
|
|
234
240
|
return doc ? doc.job : null;
|
|
235
241
|
};
|
|
236
242
|
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.29-beta-
|
|
6
|
+
"version": "1.16.29-beta-2eaf40bc",
|
|
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.29-beta-
|
|
23
|
-
"@abtnode/util": "1.16.29-beta-
|
|
22
|
+
"@abtnode/db": "1.16.29-beta-2eaf40bc",
|
|
23
|
+
"@abtnode/util": "1.16.29-beta-2eaf40bc",
|
|
24
24
|
"debug": "^4.3.4",
|
|
25
25
|
"fastq": "^1.17.1",
|
|
26
26
|
"uuid": "^9.0.1"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "d723d07ca8914468fc1b53af23aa53dc343e0a8c",
|
|
29
29
|
"devDependencies": {
|
|
30
30
|
"jest": "^29.7.0"
|
|
31
31
|
}
|