mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-08 14:19:01 +08:00
fix(crawl-status): improve finished checking
This commit is contained in:
parent
e6531278f6
commit
078c0679aa
@ -13,6 +13,7 @@ import {
|
|||||||
getDoneJobsOrderedLength,
|
getDoneJobsOrderedLength,
|
||||||
getThrottledJobs,
|
getThrottledJobs,
|
||||||
isCrawlFinished,
|
isCrawlFinished,
|
||||||
|
isCrawlFinishedLocked,
|
||||||
} from "../../lib/crawl-redis";
|
} from "../../lib/crawl-redis";
|
||||||
import { getScrapeQueue } from "../../services/queue-service";
|
import { getScrapeQueue } from "../../services/queue-service";
|
||||||
import {
|
import {
|
||||||
@ -117,7 +118,7 @@ export async function crawlStatusController(
|
|||||||
sc.cancelled
|
sc.cancelled
|
||||||
? "cancelled"
|
? "cancelled"
|
||||||
: validJobStatuses.every((x) => x[1] === "completed") &&
|
: validJobStatuses.every((x) => x[1] === "completed") &&
|
||||||
await isCrawlFinished(req.params.jobId)
|
(await isCrawlFinishedLocked(req.params.jobId) || await isCrawlFinished(req.params.jobId))
|
||||||
? "completed"
|
? "completed"
|
||||||
: "scraping";
|
: "scraping";
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user