Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

Update crawl-cancel.ts

Nicolas9a1a227797c2
diff --git a/apps/api/src/controllers/crawl-cancel.ts b/apps/api/src/controllers/crawl-cancel.ts
index a5e28323f..ff4b2c585 100644
--- a/apps/api/src/controllers/crawl-cancel.ts
+++ b/apps/api/src/controllers/crawl-cancel.ts
@@ -52,6 +52,7 @@ export async function crawlCancelController(req: Request, res: Response) {
try {
await getWebScraperQueue().client.del(job.lockKey());
await job.takeLock();
+ await job.discard();
await job.moveToFailed(Error("Job cancelled by user"), true);
} catch (error) {
console.error(error);