@joystick.js/node-canary 0.0.0-canary.297 → 0.0.0-canary.299
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/dist/app/queues/index.js +4 -9
- package/package.json +1 -1
package/dist/app/queues/index.js
CHANGED
|
@@ -113,11 +113,10 @@ class Queue {
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
if (!isNaN(job_definition?.maxAttempts)) {
|
|
116
|
-
console.log({
|
|
117
|
-
...nextJob,
|
|
118
|
-
maxAttempts: job_definition?.maxAttempts
|
|
119
|
-
});
|
|
120
116
|
if (nextJob?.attempts >= parseInt(job_definition?.maxAttempts, 10)) {
|
|
117
|
+
if (typeof job_definition?.onMaxAttemptsExhausted === "function") {
|
|
118
|
+
await job_definition.onMaxAttemptsExhausted(nextJob);
|
|
119
|
+
}
|
|
121
120
|
return this._handleDeleteJob(nextJob?._id);
|
|
122
121
|
}
|
|
123
122
|
}
|
|
@@ -142,12 +141,8 @@ class Queue {
|
|
|
142
141
|
return this.db.setJobCompleted(jobId);
|
|
143
142
|
}
|
|
144
143
|
_handleJobFailed(nextJob = {}, job_definition = {}, error = "") {
|
|
145
|
-
console.log({
|
|
146
|
-
nextJob,
|
|
147
|
-
job_definition
|
|
148
|
-
});
|
|
149
144
|
if (job_definition?.requeueOnFailure) {
|
|
150
|
-
return this._handleRequeueJob(nextJob
|
|
145
|
+
return this._handleRequeueJob(nextJob, timestamps.get_future_time("seconds", 10));
|
|
151
146
|
}
|
|
152
147
|
return this.db.setJobFailed(nextJob?._id, error);
|
|
153
148
|
}
|