mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-12 21:58:59 +08:00
Update extract-redis.ts
This commit is contained in:
parent
2dc87a2e1c
commit
c323c64671
@ -54,6 +54,19 @@ export async function updateExtract(
|
|||||||
extract.steps = [...current.steps, ...extract.steps];
|
extract.steps = [...current.steps, ...extract.steps];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Limit links in steps to 500
|
||||||
|
if (extract.steps) {
|
||||||
|
extract.steps = extract.steps.map(step => {
|
||||||
|
if (step.discoveredLinks && step.discoveredLinks.length > 500) {
|
||||||
|
return {
|
||||||
|
...step,
|
||||||
|
discoveredLinks: step.discoveredLinks.slice(0, 500)
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return step;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
await redisConnection.set(
|
await redisConnection.set(
|
||||||
"extract:" + id,
|
"extract:" + id,
|
||||||
JSON.stringify({ ...current, ...extract }),
|
JSON.stringify({ ...current, ...extract }),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user