@joystick.js/node-canary 0.0.0-canary.343 → 0.0.0-canary.344
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.
|
@@ -63,20 +63,20 @@ var queues_default = {
|
|
|
63
63
|
}
|
|
64
64
|
const db = this.db?.collection(`queue_${this.queue.name}`);
|
|
65
65
|
const indexes = await db?.indexes();
|
|
66
|
-
db.createIndex({ status: 1 });
|
|
67
|
-
db.createIndex({ status: 1, nextRunAt: 1 });
|
|
68
|
-
db.createIndex({ status: 1, environment: 1, nextRunAt: 1, lockedBy: 1 });
|
|
66
|
+
await db.createIndex({ status: 1 });
|
|
67
|
+
await db.createIndex({ status: 1, nextRunAt: 1 });
|
|
68
|
+
await db.createIndex({ status: 1, environment: 1, nextRunAt: 1, lockedBy: 1 });
|
|
69
69
|
if (this.queue.options?.cleanup?.completedAfterSeconds) {
|
|
70
70
|
if (indexes?.find((index) => index?.name === "completedAt_1")) {
|
|
71
71
|
await db.dropIndex({ completedAt: 1 });
|
|
72
72
|
}
|
|
73
|
-
db.createIndex({ completedAt: 1 }, { expireAfterSeconds: this?.queue?.options?.cleanup?.completedAfterSeconds });
|
|
73
|
+
await db.createIndex({ completedAt: 1 }, { expireAfterSeconds: this?.queue?.options?.cleanup?.completedAfterSeconds });
|
|
74
74
|
}
|
|
75
75
|
if (this.queue.options?.cleanup?.failedAfterSeconds) {
|
|
76
76
|
if (indexes?.find((index) => index?.name === "failedAt_1")) {
|
|
77
77
|
await db.dropIndex({ failedAt: 1 });
|
|
78
78
|
}
|
|
79
|
-
db.createIndex({ failedAt: 1 }, { expireAfterSeconds: this?.queue?.options?.cleanup?.failedAfterSeconds });
|
|
79
|
+
await db.createIndex({ failedAt: 1 }, { expireAfterSeconds: this?.queue?.options?.cleanup?.failedAfterSeconds });
|
|
80
80
|
}
|
|
81
81
|
},
|
|
82
82
|
logAttempt: function(jobId = "") {
|