mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-18 07:55:59 +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 });
|
logger.info(`🐂 Worker taking job ${job.id}`, { url: job.data.url });
|
||||||
const start = job.data.startTime ?? Date.now();
|
const start = job.data.startTime ?? Date.now();
|
||||||
const remainingTime = job.data.scrapeOptions.timeout ? (job.data.scrapeOptions.timeout - (Date.now() - start)) : undefined;
|
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();
|
const costTracking = new CostTracking();
|
||||||
|
|
||||||
@ -1145,6 +1141,11 @@ async function processJob(job: Job & { id: string }, token: string) {
|
|||||||
current_url: "",
|
current_url: "",
|
||||||
});
|
});
|
||||||
|
|
||||||
|
if (remainingTime !== undefined && remainingTime < 0) {
|
||||||
|
throw new Error("timeout");
|
||||||
|
}
|
||||||
|
const signal = remainingTime ? AbortSignal.timeout(remainingTime) : undefined;
|
||||||
|
|
||||||
if (job.data.crawl_id) {
|
if (job.data.crawl_id) {
|
||||||
const sc = (await getCrawl(job.data.crawl_id)) as StoredCrawl;
|
const sc = (await getCrawl(job.data.crawl_id)) as StoredCrawl;
|
||||||
if (sc && sc.cancelled) {
|
if (sc && sc.cancelled) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user