mirror of
https://git.mirrors.martin98.com/https://github.com/mendableai/firecrawl
synced 2025-08-14 01:36:02 +08:00
Add waitFor of 5000ms for changeTracking format
Co-Authored-By: hello@sideguide.dev <hello@sideguide.dev>
This commit is contained in:
parent
5658232ed6
commit
9ab2a26636
@ -95,6 +95,23 @@ describe("Scrape tests", () => {
|
|||||||
expect(response.changeTracking).toBeDefined();
|
expect(response.changeTracking).toBeDefined();
|
||||||
expect(response.changeTracking?.previousScrapeAt).not.toBeNull();
|
expect(response.changeTracking?.previousScrapeAt).not.toBeNull();
|
||||||
}, 30000);
|
}, 30000);
|
||||||
|
|
||||||
|
it.concurrent("enforces a minimum waitFor of 5000ms", async () => {
|
||||||
|
const response1 = await scrape({
|
||||||
|
url: "https://example.com",
|
||||||
|
formats: ["markdown", "changeTracking"],
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(response1.changeTracking).toBeDefined();
|
||||||
|
|
||||||
|
const response2 = await scrape({
|
||||||
|
url: "https://example.com",
|
||||||
|
formats: ["markdown", "changeTracking"],
|
||||||
|
waitFor: 1000,
|
||||||
|
});
|
||||||
|
|
||||||
|
expect(response2.changeTracking).toBeDefined();
|
||||||
|
}, 30000);
|
||||||
|
|
||||||
it.concurrent("includes git diff when requested", async () => {
|
it.concurrent("includes git diff when requested", async () => {
|
||||||
const response = await scrape({
|
const response = await scrape({
|
||||||
|
@ -390,6 +390,9 @@ export async function scrapeURL(
|
|||||||
options: ScrapeOptions,
|
options: ScrapeOptions,
|
||||||
internalOptions: InternalOptions,
|
internalOptions: InternalOptions,
|
||||||
): Promise<ScrapeUrlResponse> {
|
): Promise<ScrapeUrlResponse> {
|
||||||
|
if (options.formats.includes("changeTracking") && options.waitFor < 5000) {
|
||||||
|
options.waitFor = 5000;
|
||||||
|
}
|
||||||
const meta = await buildMetaObject(id, url, options, internalOptions);
|
const meta = await buildMetaObject(id, url, options, internalOptions);
|
||||||
try {
|
try {
|
||||||
while (true) {
|
while (true) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user