Releases: timgit/pg-boss
6.1.1
- Fixed drift in schema migration between new and upgraded instances since the 6.0.0 release. In this case, the onComplete default was still set to true for direct table integrations on new intances, but migrated to the correct default of false for upgraded instances.
6.1.0
6.0.1
6.0.0
-
CHANGE:
stop()
has been enhanced with a graceful stop feature that will signal and monitor any polling subscriptions (workers usingsubscribe()
oronComlete()
) before closing the internal connection pool and stopping maintenance operations. The defalt options,{ graceful = true, timeout = 30000 }
, will wait for 30s before shutting down. -
NEW: Added a
stopped
event that will be emitted afterstop()
when all workers have completed active jobs, or when the timeout is met, whichever is sooner. -
NEW: Added a
wip
event that will emit as jobs are both fetched and completed per instance. If no work is being done, no events will be emitted. This will emit at most once every 2 seconds for monitoring purposes. -
NEW: Added the
output
jsonb column to storage tables to store result or error data along with the original job, which were previously only available via completion jobs. This has the added benefit of storing any errors or results from completion jobs themselves, which were previously discarded. -
NEW:
getJobById(id)
can now be used to fetch a job from either primary or archive storage by id. This may be helpful if needed to inspectoutput
and you have the job id. -
NEW: Added new function,
publishSingleton()
, similar to publishOnce(), but throttles publish to only allow 1 job in the queue at a time, allowing a job to be queued even if 1 or more jobs are currently active. -
CHANGE:
subscribe()
andonComplete()
now resolve with a unique id that will be visible inwip
along with additional metadata about the subscription. -
CHANGE:
subscribe()
andonComplete()
now abort promise execution client-side based on the job's expiration. -
CHANGE:
unsubscribe()
andoffComplete()
now accept an object as an argument to allow removing a specific subscription by id. -
MAJOR: The
onComplete
publish option is now defaulted tofalse
, which breaks backward compatability for automatic creation of completion jobs. To restore the previous behavior of completion jobs being created by default, you should setonComplete
totrue
in your constructor options. -
MAJOR: The default retention policy has been reduced from 30 to 14 days. This can still be customized as an option in the constructor.
-
MAJOR: Node 10 is EOL. Node 12 is now the minimum supported version.
-
MAJOR: Added a new index to the primary job table,
job_fetch
, to improve fetch time performace as the job table size increases. Depending on how many jobs you have in your job table, creating this index may delaystart()
promise resolution. If this is a concern, you can get the SQL viagetMigrationPlans()
and create the index out of band. TheCREATE INDEX
command includes anIF NOT EXISTS
which will skip this step in the migration if already created.For example, once you have installed this package version, using the node repl, console.log the output of
getMigrationPlans()
.$ node Welcome to Node.js v14.16.1. Type ".help" for more information. > console.log(require('./node_modules/pg-boss').getMigrationPlans()) BEGIN; ... CREATE INDEX IF NOT EXISTS job_fetch ... ... COMMIT;