fix(kickoff): mark as finished if it errors out

This commit is contained in:
Gergő Móricz 2025-01-17 17:11:19 +01:00
parent 5992c57158
commit dcd3d6d98d

View File

@ -682,6 +682,11 @@ async function processKickoffJob(job: Job & { id: string }, token: string) {
return { success: true };
} catch (error) {
logger.error("An error occurred!", { error });
await finishCrawlKickoff(job.data.crawl_id);
const sc = (await getCrawl(job.data.crawl_id)) as StoredCrawl;
if (sc) {
await finishCrawlIfNeeded(job, sc);
}
return { success: false, error };
}
}