Skip to content

fix: v1 /map endpoint time_taken always ~0#3243

Merged
micahstairs merged 1 commit intofirecrawl:mainfrom
Bortlesboat:fix/map-v1-time-taken
Mar 29, 2026
Merged

fix: v1 /map endpoint time_taken always ~0#3243
micahstairs merged 1 commit intofirecrawl:mainfrom
Bortlesboat:fix/map-v1-time-taken

Conversation

@Bortlesboat
Copy link
Copy Markdown
Contributor

@Bortlesboat Bortlesboat commented Mar 28, 2026

Summary

  • Fixes bug: v1 /map endpoint time_taken is always ~0 #3165 — v1 /map endpoint time_taken was always ~0
  • Root cause: (new Date().getTime() - Date.now()) / 1000 computes two timestamps on the same line, result is always ~0
  • Fix: capture Date.now() at function entry into startTime, compute elapsed at the end
  • Matches the pattern already used in the v2 map endpoint (map-utils.ts)

Changes

  • apps/api/src/controllers/v1/map.ts — 2 lines changed

Test plan

  • time_taken now reflects actual execution time
  • Consistent with v2 map endpoint implementation

Summary by cubic

Fixes v1 /map endpoint time_taken always being ~0 by capturing Date.now() at function start and computing elapsed at return. Values now reflect real execution time and match the v2 endpoint behavior.

Written for commit fe12ea3. Summary will update on new commits.

Capture Date.now() at function entry and subtract it at the end,
matching the pattern used in the v2 map endpoint. Previously,
both timestamps were taken on the same line, always yielding ~0.

Fixes firecrawl#3165
Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 1 file

@micahstairs micahstairs merged commit 26eacb9 into firecrawl:main Mar 29, 2026
2 of 3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: v1 /map endpoint time_taken is always ~0

2 participants