Skip to content

Releases: timgit/pg-boss

6.1.1

25 Jun 17:51
Compare
Choose a tag to compare
  • 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

18 Jun 17:44
3044aef
Compare
Choose a tag to compare
  • Existing schemas can now be used via the schema property in the constructor.
  • Fixed expiration rejection in subscriptions when the pg driver wasn't returning an interval object.
  • Removed timers causing process to hang during shut down

6.0.1

01 Jun 02:53
Compare
Choose a tag to compare
  • Typescript types updated for stop(). PR from @stnwk

6.0.0

31 May 17:10
dee5426
Compare
Choose a tag to compare
  • CHANGE: stop() has been enhanced with a graceful stop feature that will signal and monitor any polling subscriptions (workers using subscribe() or onComlete()) 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 after stop() 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 inspect output 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() and onComplete() now resolve with a unique id that will be visible in wip along with additional metadata about the subscription.

  • CHANGE: subscribe() and onComplete() now abort promise execution client-side based on the job's expiration.

  • CHANGE: unsubscribe() and offComplete() now accept an object as an argument to allow removing a specific subscription by id.

  • MAJOR: The onComplete publish option is now defaulted to false, which breaks backward compatability for automatic creation of completion jobs. To restore the previous behavior of completion jobs being created by default, you should set onComplete to true 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 delay start() promise resolution. If this is a concern, you can get the SQL via getMigrationPlans() and create the index out of band. The CREATE INDEX command includes an IF 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;

5.2.3

30 Mar 22:36
Compare
Choose a tag to compare
  • Dependency PR from dependabot

5.2.2

17 Mar 03:09
Compare
Choose a tag to compare
  • Typescript types updated to support retentionSeconds option as well as EventEmitter.off(). PR from @fiznool
  • Updated dependencies

5.2.1

25 Feb 02:41
45309f6
Compare
Choose a tag to compare
  • Typescript types updated to support archiveCompletedAfterSeconds constructor option.

5.2.0

09 Feb 17:36
c00642b
Compare
Choose a tag to compare
  • Added constructor and publish option onComplete to opt out of creating a completion job in the queue once a job is completed. This defaults to true for backwards compatibility.
  • Replaced bluebird dependency with p-map and delay.

5.1.0

30 Jan 16:14
0f2d6a8
Compare
Choose a tag to compare
  • Added transactional locking to maintenance queries as a safeguard from deadlocks under load.
  • Removed maintenance events, archived, deleted, and expired.

5.0.8

20 Aug 00:33
Compare
Choose a tag to compare
  • Retention policy applied to abandoned jobs in retry state.
  • Cron monitoring properly disabled when archive interval is set lower than 1 minute.