Skip to content

Increase job expiration timeout and surface Bottleneck errors to callers#49

Merged
FreekBes merged 4 commits intomainfrom
copilot/modify-bottleneck-error-handling
Mar 18, 2026
Merged

Increase job expiration timeout and surface Bottleneck errors to callers#49
FreekBes merged 4 commits intomainfrom
copilot/modify-bottleneck-error-handling

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Mar 18, 2026

BottleneckErrors were too frequent due to a tight 20 s job expiration, and when they did occur they were silently swallowed rather than propagated to the caller.

Changes

  • Job expiration default: 20 000 ms → 60 000 ms — reduces timeout-driven BottleneckErrors under load
  • Error propagationBottleneckErrors from schedule() already reject the returned Promise; no extra wiring needed. Callers of get(), post(), patch(), etc. can now catch them normally:
try {
  const response = await api.get('/users');
} catch (err) {
  // BottleneckError lands here — safe to retry
  if (err instanceof Error && err.constructor.name === 'BottleneckError') {
    // retry logic
  }
}

The on("error") handlers are intentionally left as console.error — they handle infrastructure-level errors (e.g. Redis) that are not tied to individual requests.


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI and others added 3 commits March 18, 2026 14:39
Co-authored-by: FreekBes <36384333+FreekBes@users.noreply.github.com>
Co-authored-by: FreekBes <36384333+FreekBes@users.noreply.github.com>
…error handler

Co-authored-by: FreekBes <36384333+FreekBes@users.noreply.github.com>
Copilot AI changed the title [WIP] Increase timeout and enhance BottleneckError handling Increase job expiration timeout and surface Bottleneck errors to callers Mar 18, 2026
Copilot AI requested a review from FreekBes March 18, 2026 14:51
@FreekBes FreekBes marked this pull request as ready for review March 18, 2026 14:52
@FreekBes FreekBes merged commit afe4190 into main Mar 18, 2026
1 check passed
@FreekBes FreekBes deleted the copilot/modify-bottleneck-error-handling branch March 18, 2026 14:54
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.

2 participants