timgit/pg-boss

queue maintenance with serverless workers

guy-borderless opened this issue · 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?

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

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

timgit commented

Yes! Thanks