@joystick.js/node-canary 0.0.0-canary.339 → 0.0.0-canary.340

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.
@@ -9,7 +9,7 @@ var queues_default = {
9
9
  },
10
10
  countJobs: function(status = "") {
11
11
  const db = this.db?.collection(`queue_${this.queue.name}`);
12
- return db.countDocuments({ status });
12
+ return db.countDocuments({ status, lockedBy: this.machineId });
13
13
  },
14
14
  deleteJob: function(jobId = "") {
15
15
  const db = this.db?.collection(`queue_${this.queue.name}`);
@@ -34,8 +34,11 @@ var queues_default = {
34
34
  queue_${this.queue.name}
35
35
  WHERE
36
36
  status = $1
37
+ AND
38
+ locked_by = $2
37
39
  `, [
38
- status
40
+ status,
41
+ this.machineId
39
42
  ]);
40
43
  return Promise.resolve(jobs.count);
41
44
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@joystick.js/node-canary",
3
- "version": "0.0.0-canary.339",
3
+ "version": "0.0.0-canary.340",
4
4
  "type": "module",
5
5
  "description": "A Node.js framework for building web apps.",
6
6
  "main": "./dist/index.js",