Skip to content

Commit

Permalink
fix job failure for stately queues (#493)
Browse files Browse the repository at this point in the history
* fix job failure for stately queues
  • Loading branch information
timgit authored Sep 14, 2024
1 parent f9827ac commit b202aba
Show file tree
Hide file tree
Showing 5 changed files with 237 additions and 104 deletions.
10 changes: 6 additions & 4 deletions docs/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -983,10 +983,12 @@ Allowed policy values:
| Policy | Description |
| - | - |
| standard | (Default) Supports all standard features such as deferral, priority, and throttling |
| short | All standard features, but only allows 1 job to be queued, unlimited active. Can be extended with `singletonKey` |
| singleton | All standard features, but only allows 1 job to be active, unlimited queued. Can be extended with `singletonKey` |
| stately | Combination of short and singleton: Only allows 1 job per state, queued and/or active. Can be extended with `singletonKey` |
| `standard` | (Default) Supports all standard features such as deferral, priority, and throttling |
| `short` | All standard features, but only allows 1 job to be queued, unlimited active. Can be extended with `singletonKey` |
| `singleton` | All standard features, but only allows 1 job to be active, unlimited queued. Can be extended with `singletonKey` |
| `stately` | Combination of short and singleton: Only allows 1 job per state, queued and/or active. Can be extended with `singletonKey` |
> `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.
## `updateQueue(name, options)`
Expand Down
159 changes: 80 additions & 79 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
{
"name": "pg-boss",
"version": "10.1.2",
"version": "10.1.3",
"description": "Queueing jobs in Postgres from Node.js like a boss",
"main": "./src/index.js",
"engines": {
"node": ">=20"
},
"dependencies": {
"cron-parser": "^4.0.0",
"pg": "^8.5.1",
"cron-parser": "^4.9.0",
"pg": "^8.12.0",
"serialize-error": "^8.1.0"
},
"devDependencies": {
"@types/node": "^20.3.3",
"luxon": "^3.0.1",
"mocha": "^10.0.0",
"@types/node": "^20.16.5",
"luxon": "^3.5.0",
"mocha": "^10.7.3",
"nyc": "^17.0.0",
"standard": "^17.0.0"
"standard": "^17.1.2"
},
"scripts": {
"test": "standard && mocha",
Expand Down
Loading

0 comments on commit b202aba

Please sign in to comment.