fix(crawl): failed behaviour
This commit is contained in:
@@ -404,9 +404,9 @@ async function processJob(job: Job & { id: string }, token: string) {
|
|||||||
const jobIDs = await getCrawlJobs(job.data.crawl_id);
|
const jobIDs = await getCrawlJobs(job.data.crawl_id);
|
||||||
|
|
||||||
const jobs = (await getJobs(jobIDs)).sort((a, b) => a.timestamp - b.timestamp);
|
const jobs = (await getJobs(jobIDs)).sort((a, b) => a.timestamp - b.timestamp);
|
||||||
const jobStatuses = await Promise.all(jobs.map((x) => x.getState()));
|
// const jobStatuses = await Promise.all(jobs.map((x) => x.getState()));
|
||||||
const jobStatus =
|
const jobStatus =
|
||||||
sc.cancelled || jobStatuses.some((x) => x === "failed")
|
sc.cancelled // || jobStatuses.some((x) => x === "failed")
|
||||||
? "failed"
|
? "failed"
|
||||||
: "completed";
|
: "completed";
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user