Skip to content

Commit b202aba

Browse files
authored
fix job failure for stately queues (#493)
* fix job failure for stately queues
1 parent f9827ac commit b202aba

File tree

5 files changed

+237
-104
lines changed

5 files changed

+237
-104
lines changed

docs/readme.md

+6-4
Original file line numberDiff line numberDiff line change
@@ -983,10 +983,12 @@ Allowed policy values:
983983
984984
| Policy | Description |
985985
| - | - |
986-
| standard | (Default) Supports all standard features such as deferral, priority, and throttling |
987-
| short | All standard features, but only allows 1 job to be queued, unlimited active. Can be extended with `singletonKey` |
988-
| singleton | All standard features, but only allows 1 job to be active, unlimited queued. Can be extended with `singletonKey` |
989-
| stately | Combination of short and singleton: Only allows 1 job per state, queued and/or active. Can be extended with `singletonKey` |
986+
| `standard` | (Default) Supports all standard features such as deferral, priority, and throttling |
987+
| `short` | All standard features, but only allows 1 job to be queued, unlimited active. Can be extended with `singletonKey` |
988+
| `singleton` | All standard features, but only allows 1 job to be active, unlimited queued. Can be extended with `singletonKey` |
989+
| `stately` | Combination of short and singleton: Only allows 1 job per state, queued and/or active. Can be extended with `singletonKey` |
990+
991+
> `stately` queues are special in how retries are handled. By definition, stately queues will not allow multiple jobs to occupy `retry` state. Once a job exists in `retry`, failing another `active` job will bypass the retry mechanism and force the job to `failed`. If this job requires retries, consider a custom retry implementation using a dead letter queue.
990992
991993
## `updateQueue(name, options)`
992994

package-lock.json

+80-79
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,22 @@
11
{
22
"name": "pg-boss",
3-
"version": "10.1.2",
3+
"version": "10.1.3",
44
"description": "Queueing jobs in Postgres from Node.js like a boss",
55
"main": "./src/index.js",
66
"engines": {
77
"node": ">=20"
88
},
99
"dependencies": {
10-
"cron-parser": "^4.0.0",
11-
"pg": "^8.5.1",
10+
"cron-parser": "^4.9.0",
11+
"pg": "^8.12.0",
1212
"serialize-error": "^8.1.0"
1313
},
1414
"devDependencies": {
15-
"@types/node": "^20.3.3",
16-
"luxon": "^3.0.1",
17-
"mocha": "^10.0.0",
15+
"@types/node": "^20.16.5",
16+
"luxon": "^3.5.0",
17+
"mocha": "^10.7.3",
1818
"nyc": "^17.0.0",
19-
"standard": "^17.0.0"
19+
"standard": "^17.1.2"
2020
},
2121
"scripts": {
2222
"test": "standard && mocha",

0 commit comments

Comments
 (0)