const active = await pdfBulkQueue.getActive(); const staleThreshold = 10 * 60 * 1000; // 10 minutes const stale = active.filter(job => Date.now() - job.timestamp > staleThreshold ); for (const job of stale) { await job.moveToFailed(new Error('Manually failed: stale job'), true); } __ __