pg-boss

Queueing jobs in Postgres from Node.js like a boss

MIT License

Downloads
267.8K
Stars
2.1K
Committers
52

Bot releases are visible (Hide)

pg-boss -

Published by timgit about 3 years ago

  • Typescript defs patch
pg-boss -

Published by timgit about 3 years ago

  • Typescript defs patch
pg-boss -

Published by timgit about 3 years ago

  • Typescript defs patch
pg-boss -

Published by timgit about 3 years ago

  • Added constructor option db for using an external/existing database connection.
    This bypasses having to create an additional connection pool.
pg-boss -

Published by timgit about 3 years ago

  • Patch to prevented state transition jobs from being created from existing state transition jobs.
    Kind of meta. These were unfetchable and therefor just clutter.
pg-boss -

Published by timgit about 3 years ago

  • Patch to allow custom schema name with a connectionString constructor option
pg-boss -

Published by timgit about 3 years ago

  • Patch to fix missing error on failed event. via PR #37
pg-boss -

Published by timgit about 3 years ago

  • Patch to fix typescript types path
pg-boss -

Published by timgit about 3 years ago

  • Typescript defs
pg-boss -

Published by timgit about 3 years ago

  • Patched pg driver to 7.1
pg-boss -

Published by timgit about 3 years ago

  • Upgrade pg driver to 7.0
pg-boss -

Published by timgit about 3 years ago

  • Added state transition jobs and api for orchestration/saga support.
  • Added job fetch batching
pg-boss -

Published by timgit over 3 years ago

  • Typescript types and docs updated for stop(). PR from @fiznool
pg-boss -

Published by timgit over 3 years ago

  • 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.
pg-boss -

Published by timgit over 3 years ago

  • 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
pg-boss -

Published by timgit over 3 years ago

  • Typescript types updated for stop(). PR from @stnwk
pg-boss -

Published by timgit over 3 years ago

  • 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;
    
pg-boss -

Published by timgit over 3 years ago

  • Dependency PR from dependabot
pg-boss -

Published by timgit over 3 years ago

  • Typescript types updated to support retentionSeconds option as well as EventEmitter.off(). PR from @fiznool
  • Updated dependencies
pg-boss - 5.2.1

Published by timgit over 3 years ago

  • Typescript types updated to support archiveCompletedAfterSeconds constructor option.