mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-13 04:49:08 +08:00
fix: crawl status and redis fixes
This commit is contained in:
parent
3fcb21930e
commit
5896153d19
@ -53,8 +53,10 @@ export async function crawlStatusController(req: RequestWithAuth<CrawlStatusPara
|
||||
used++;
|
||||
}
|
||||
|
||||
doneJobs.splice(doneJobs.length - 1, 1);
|
||||
used--;
|
||||
if (used < doneJobsOrder.length) {
|
||||
doneJobs.splice(doneJobs.length - 1, 1);
|
||||
used--;
|
||||
}
|
||||
} else {
|
||||
doneJobs = (await Promise.all(doneJobsOrder.map(async x => await getJob(x))));
|
||||
}
|
||||
|
@ -28,8 +28,9 @@ export async function getCrawl(id: string): Promise<StoredCrawl | null> {
|
||||
|
||||
export async function getCrawlExpiry(id: string): Promise<Date> {
|
||||
const d = new Date();
|
||||
const ttl = await redisConnection.ttl(id);
|
||||
d.setSeconds(d.getSeconds() + ttl);
|
||||
const ttl = await redisConnection.pttl("crawl:" + id);
|
||||
d.setMilliseconds(d.getMilliseconds() + ttl);
|
||||
d.setMilliseconds(0);
|
||||
return d;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user