Update crawl-cancel.ts

This commit is contained in:
Nicolas 2024-07-18 13:40:24 -04:00
parent d2de01d342
commit ce804d3c20

View File

@ -50,6 +50,8 @@ export async function crawlCancelController(req: Request, res: Response) {
} }
try { try {
await getWebScraperQueue().client.del(job.lockKey());
await job.takeLock();
await job.moveToFailed(Error("Job cancelled by user"), true); await job.moveToFailed(Error("Job cancelled by user"), true);
} catch (error) { } catch (error) {
console.error(error); console.error(error);