mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-17 23:05:57 +08:00
fix: proper level
This commit is contained in:
parent
656c769f73
commit
daa7fc58f6
@ -1130,10 +1130,6 @@ async function processJob(job: Job & { id: string }, token: string) {
|
||||
logger.info(`🐂 Worker taking job ${job.id}`, { url: job.data.url });
|
||||
const start = job.data.startTime ?? Date.now();
|
||||
const remainingTime = job.data.scrapeOptions.timeout ? (job.data.scrapeOptions.timeout - (Date.now() - start)) : undefined;
|
||||
if (remainingTime !== undefined && remainingTime < 0) {
|
||||
throw new Error("timeout");
|
||||
}
|
||||
const signal = remainingTime ? AbortSignal.timeout(remainingTime) : undefined;
|
||||
|
||||
const costTracking = new CostTracking();
|
||||
|
||||
@ -1145,6 +1141,11 @@ async function processJob(job: Job & { id: string }, token: string) {
|
||||
current_url: "",
|
||||
});
|
||||
|
||||
if (remainingTime !== undefined && remainingTime < 0) {
|
||||
throw new Error("timeout");
|
||||
}
|
||||
const signal = remainingTime ? AbortSignal.timeout(remainingTime) : undefined;
|
||||
|
||||
if (job.data.crawl_id) {
|
||||
const sc = (await getCrawl(job.data.crawl_id)) as StoredCrawl;
|
||||
if (sc && sc.cancelled) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user