timgit / pg-boss

Queueing jobs in Postgres from Node.js like a boss
MIT License
2.15k stars 160 forks source link

Reconnect PgBoss Job Handlers when database come alive from a failure #510

Open kasvith opened 1 month ago

kasvith commented 1 month ago

Hi,

Currently in one of our production apps, if DB is unavailable on app startup pgboss fails to register job handlers. When the DB comes online pgboss never attempts to reconnect and register job handlers again, so these job handlers become stalled

is there a way we can solve this? an event to know when db reconnects or a way to find which job handlers were successfully registered

timgit commented 1 month ago

If the db is unavailable, start() would also fail. Do you have a way you can poll your database to determine when it's back up?