pg-boss icon indicating copy to clipboard operation
pg-boss copied to clipboard

queue maintenance with serverless workers

Open guy-borderless opened this issue 2 years ago • 3 comments

If I offload job handling to serverless functions that take work via fetch(). How do I run queue maintenance periodically, preferably without creating a non-serverless queue worker? Is this scenario supported?

guy-borderless avatar Apr 19 '23 10:04 guy-borderless

Running start() will automatically run maintenance unless you've opted out of this. If so, you may want to create a dedicated function that runs on a cron and stays alive long enough to handle maintenance. You also won't have reliable scheduling if you don't keep a supervisor process running

timgit avatar Apr 19 '23 22:04 timgit

Would you consider a PR that would allow a "serverless mode" to the queue (I'm currently using qstash)? something like a function that can be called periodically to run maintenance, set schedules, and ping the URLs of the job handlers according to the number of open jobs

guy-borderless avatar Apr 21 '23 06:04 guy-borderless

Yes! Thanks

timgit avatar Apr 29 '23 22:04 timgit

This is supported now in v10

timgit avatar Aug 17 '24 22:08 timgit