Skip to content

Commit bdad368

Browse files
committed
fix(firecrawl): cancel only a job Firecrawl returned an id for
1 parent ec0d700 commit bdad368

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/sim/tools/firecrawl/batch-scrape.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@ export const batchScrapeTool: ToolConfig<FirecrawlBatchScrapeParams, FirecrawlBa
248248
await interruptibleSleep(POLL_INTERVAL_MS, signal)
249249
elapsedTime += POLL_INTERVAL_MS
250250
} catch (error: any) {
251-
if (signal?.aborted)
251+
if (signal?.aborted && jobId)
252252
await cancelFirecrawlJob(`batch/scrape/${encodeURIComponent(jobId)}`, params.apiKey)
253253
logger.error('Error polling for batch scrape job status:', {
254254
message: error.message || 'Unknown error',

‎apps/sim/tools/firecrawl/crawl.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,7 @@ export const crawlTool: ToolConfig<FirecrawlCrawlParams, FirecrawlCrawlResponse>
289289
await interruptibleSleep(POLL_INTERVAL_MS, signal)
290290
elapsedTime += POLL_INTERVAL_MS
291291
} catch (error: any) {
292-
if (signal?.aborted)
292+
if (signal?.aborted && jobId)
293293
await cancelFirecrawlJob(`crawl/${encodeURIComponent(jobId)}`, params.apiKey)
294294
logger.error('Error polling for crawl job status:', {
295295
message: error.message || 'Unknown error',

0 commit comments

Comments
 (0)