@joystick.js/node-canary 0.0.0-canary.291 → 0.0.0-canary.292
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.
|
@@ -2,7 +2,10 @@ import getTargetDatabaseProvider from "../../getTargetDatabaseProvider.js";
|
|
|
2
2
|
var queues_default = {
|
|
3
3
|
addJob: function(jobToAdd = {}) {
|
|
4
4
|
const db = this.db?.collection(`queue_${this.queue.name}`);
|
|
5
|
-
return db.insertOne(
|
|
5
|
+
return db.insertOne({
|
|
6
|
+
...jobToAdd,
|
|
7
|
+
attempts: 0
|
|
8
|
+
});
|
|
6
9
|
},
|
|
7
10
|
countJobs: function(status = "") {
|
|
8
11
|
const db = this.db?.collection(`queue_${this.queue.name}`);
|
|
@@ -9,16 +9,18 @@ var queues_default = {
|
|
|
9
9
|
status,
|
|
10
10
|
job,
|
|
11
11
|
payload,
|
|
12
|
-
next_run_at
|
|
12
|
+
next_run_at,
|
|
13
|
+
attempts
|
|
13
14
|
) VALUES (
|
|
14
|
-
$1, $2, $3, $4, $5
|
|
15
|
+
$1, $2, $3, $4, $5, $6
|
|
15
16
|
)
|
|
16
17
|
`, [
|
|
17
18
|
jobToAdd?._id,
|
|
18
19
|
jobToAdd?.status,
|
|
19
20
|
jobToAdd?.job,
|
|
20
21
|
JSON.stringify(jobToAdd?.payload),
|
|
21
|
-
jobToAdd?.nextRunAt
|
|
22
|
+
jobToAdd?.nextRunAt,
|
|
23
|
+
0
|
|
22
24
|
]);
|
|
23
25
|
},
|
|
24
26
|
countJobs: async function(status = "") {
|