mirror of
https://github.com/mendableai/firecrawl.git
synced 2024-11-16 11:42:24 +08:00
fix/added unkwown status to job filter
This commit is contained in:
parent
ca51521625
commit
2d3d7c827a
|
@ -60,7 +60,7 @@ export async function crawlStatusController(req: Request, res: Response) {
|
|||
}));
|
||||
|
||||
// Filter out failed jobs
|
||||
jobsWithStatuses = jobsWithStatuses.filter(x => x.status !== "failed");
|
||||
jobsWithStatuses = jobsWithStatuses.filter(x => x.status !== "failed" && x.status !== "unknown");
|
||||
|
||||
// Sort jobs by timestamp
|
||||
jobsWithStatuses.sort((a, b) => a.job.timestamp - b.job.timestamp);
|
||||
|
|
|
@ -101,7 +101,7 @@ async function crawlStatusWS(ws: WebSocket, req: RequestWithAuth<CrawlStatusPara
|
|||
// filter out failed jobs
|
||||
jobIDs = jobIDs.filter(id => !jobStatuses.some(status => status[0] === id && status[1] === "failed"));
|
||||
// filter the job statues
|
||||
jobStatuses = jobStatuses.filter(x => x[1] !== "failed");
|
||||
jobStatuses = jobStatuses.filter(x => x[1] !== "failed" && x[1] !== "unknown");
|
||||
const status: Exclude<CrawlStatusResponse, ErrorResponse>["status"] = sc.cancelled ? "cancelled" : jobStatuses.every(x => x[1] === "completed") ? "completed" : "scraping";
|
||||
const doneJobs = await getJobs(doneJobIDs);
|
||||
const data = doneJobs.map(x => x.returnvalue);
|
||||
|
|
Loading…
Reference in New Issue
Block a user