Skip to content

Supercharge your AI agents with data from the web and beyond. Building the library for superintelligence. 🔥

fix(v2/crawl): make kickoff-failure duration stable across polls

firecrawl-spring[bot]55242d5bbbba
diff --git a/apps/api/src/controllers/v2/crawl-status.ts b/apps/api/src/controllers/v2/crawl-status.ts
index 6883ab7e4..ba8b6f677 100644
--- a/apps/api/src/controllers/v2/crawl-status.ts
+++ b/apps/api/src/controllers/v2/crawl-status.ts
@@ -267,7 +267,8 @@ export async function crawlStatusController(
data: [],
...(createdAtMs && {
createdAt: new Date(createdAtMs).toISOString(),
- duration: Math.max(0, (Date.now() - createdAtMs) / 1000),
+ completedAt: new Date(createdAtMs).toISOString(),
+ duration: 0,
}),
});
}
diff --git a/apps/api/src/controllers/v2/types.ts b/apps/api/src/controllers/v2/types.ts
index 4748ac1d0..a103d40dd 100644
--- a/apps/api/src/controllers/v2/types.ts
+++ b/apps/api/src/controllers/v2/types.ts
@@ -1452,6 +1452,7 @@ export type CrawlStatusResponse =
creditsUsed: number;
expiresAt: string;
createdAt?: string;
+ completedAt?: string;
duration?: number;
data: Document[];
};