Usage in serverless environment #403
-
I'm working with a next js application deployed on Vercel backed by postgres. Below are some of the things I've been considering...
Any thoughts on this welcome! Thanks |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Yes, I would recommend using the fetch/complete/fail API since these aren't polling the database looking for work. Starting an instance of pg-boss is not expensive, especially if you're skipping the maintenance via noSupervisor. If you choose to do that, you would want to start an instance in a cron at some point to ensure things like the retention policy are being enforced. I haven't added a maintenance API yet to run this manually, but that would probably be ideal in order to know when it's done. Until then, you can listen for the maintenance event and then stop it. |
Beta Was this translation helpful? Give feedback.
Yes, I would recommend using the fetch/complete/fail API since these aren't polling the database looking for work. Starting an instance of pg-boss is not expensive, especially if you're skipping the maintenance via noSupervisor. If you choose to do that, you would want to start an instance in a cron at some point to ensure things like the retention policy are being enforced. I haven't added a maintenance API yet to run this manually, but that would probably be ideal in order to know when it's done. Until then, you can listen for the maintenance event and then stop it.