feat: user specific queue for run

This commit is contained in:
Rohit
2025-03-12 23:08:51 +05:30
parent 30e67c78ca
commit 5657abb21e

View File

@@ -658,10 +658,12 @@ router.post('/runs/run/:id', requireSignIn, async (req: AuthenticatedRequest, re
} }
try { try {
const userQueueName = `execute-run-user-${req.user.id}`;
// Queue the execution job // Queue the execution job
await pgBoss.createQueue('execute-run'); await pgBoss.createQueue(userQueueName);
const jobId = await pgBoss.send('execute-run', { const jobId = await pgBoss.send(userQueueName, {
userId: req.user.id, userId: req.user.id,
runId: req.params.id, runId: req.params.id,
browserId: plainRun.browserId browserId: plainRun.browserId