Skip to content

Commit f764fcb

Browse files
harryadelBastienRodz
authored andcommitted
await getJob
1 parent 8520daa commit f764fcb

File tree

7 files changed

+7
-8
lines changed

7 files changed

+7
-8
lines changed

server/imports/actions/add/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Utilities } from "../../utilities"
33
const add = async function () {
44
// 0. Prepare variables
55
let error, result, blockAdd;
6-
6+
77
// 1. Process arguments + prepare the data
88
const input = Utilities.helpers.processJobArguments(arguments);
99

server/imports/actions/cancel/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ const cancel = async function (job, callback) {
44
let error;
55
let result;
66

7-
const jobDoc = Utilities.helpers.getJob(job, {
7+
const jobDoc = await Utilities.helpers.getJob(job, {
88
allow: ["pending", "failure"],
99
message: "Unable to cancel job - not found or is resolved: "
1010
})

server/imports/actions/execute/process.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ const process = async function (doc, callback) {
1111
const Toolbelt = new toolbelt(doc);
1212

1313
try {
14-
debugger;
1514
const res = Utilities.registry.data[doc.name].apply(Toolbelt, doc.arguments);
1615
const jobResult = Promise.await(Promise.resolve(res));
1716
const resolution = Toolbelt.checkForResolution(jobResult);

server/imports/actions/execute/toolbelt.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ const toolbelt = function (jobDoc) {
174174
"Job has failed: " + queueName + ", " + docId,
175175
"Queue was stopped; please correct your job function and restart the server"
176176
]);
177-
debugger;
177+
178178
await Operator.manager.queues[queueName].stop();
179179

180180
instance.resolved = true;

server/imports/actions/remove/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Utilities } from "../../utilities"
33
const remove = async function (job, callback) {
44
let error;
55
let result;
6-
const jobDoc = Utilities.helpers.getJob(job);
6+
const jobDoc = await Utilities.helpers.getJob(job);
77

88
if (typeof jobDoc === "object") {
99
result = await Utilities.collection.removeAsync(jobDoc._id)

server/imports/actions/replicate/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { Utilities } from "../../utilities"
33
const replicate = async function (job, config, callback) {
44
let error;
55
let result;
6-
const jobDoc = Utilities.helpers.getJob(job);
6+
const jobDoc = await Utilities.helpers.getJob(job);
77

88
if (typeof jobDoc === "object") {
99
const replicant = Utilities.helpers.generateJobDoc({

server/imports/actions/reschedule/index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { Utilities } from "../../utilities"
33
const reschedule = async function (job, config, callback) {
44
let error;
55
let result;
6-
7-
const jobDoc = Utilities.helpers.getJob(job, {
6+
7+
const jobDoc = await Utilities.helpers.getJob(job, {
88
allow: ["pending", "failure"],
99
message: 'Unable to reschedule. Job does not exist or has been resolved: '
1010
});

0 commit comments

Comments
 (0)