Open nahtnam opened 3 months ago
When using pgboss
do you await boss.work()
? Looks like the process is killed and respawned very quickly and do not have time to actually process the job, you should await queue.start() when using prisma queue (which is basically the equivalent of boss.work
).
No, I wrote the code in the same way with void in the top level
Got it to work!
async function init() {
await emailQueue.start();
}
void init()
Do you foresee any problems with this?
EDIT: nvm, still seems to infinite loop
Hey! My project uses prisma and this looked pretty convenient so I wanted to give it a shot.
I'm facing an issue where the worker is getting stuck in an infinite loop. As soon as I add a job, it prints out an infinite amount of:
I noticed that in the DB, the job is not being removed. NOTE: I'm not
awaiting
the.start()
Code:
My use case is I'm running Next.js in a container and just want this to run in the background. So I just put the
void emailQueue.start()
so that it does it in the background. This strategy seems to work with pgboss