Skip to content

Add retry count tracking with exponential backoff - #26

Closed
Billos with Copilot wants to merge 3 commits into
mainfrom
copilot/add-retry-notification-feature
Closed

Add retry count tracking with exponential backoff#26
Billos with Copilot wants to merge 3 commits into
mainfrom
copilot/add-retry-notification-feature

Conversation

Copilot AI commented Feb 14, 2026

Copy link
Copy Markdown
Contributor

Jobs now track retry attempts in memory and implement exponential backoff with capped delays. Notifications display retry numbers for visibility into failure patterns.

Changes

  • Type system: Added retryCount?: number to JobArgs to persist retry state across job lifecycle
  • Retry logic: Modified delayJob() to increment retry count and calculate delay as min(2^(n-1), 60) minutes
  • Observability: Notifications and logs now include retry number (e.g., "Retry Fix(webhook): Corrects webhook job execution #3")

Behavior

Retry delays follow: 1min → 2min → 4min → 8min → 16min → 32min → 60min (capped)

const retryCount = (job.data.retryCount || 0) + 1
const delayMinutes = Math.min(Math.pow(2, retryCount - 1), 60)
const message = `Delaying job **${job.data.job}** until ${delayed.toISOTime()} - **Retry #${retryCount}**`
await job.updateData({ ...job.data, delayedMessageId, retryCount })

Cap at 60 minutes prevents unbounded delays for persistent failures (retry #20 would otherwise delay ~1 year).

Original prompt

when retrying, keep in memory the retry number, display it in the notification, and increase the retry delay according to the retry number


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits February 14, 2026 22:08
…fications

Co-authored-by: Billos <5809662+Billos@users.noreply.github.com>
Co-authored-by: Billos <5809662+Billos@users.noreply.github.com>
Copilot AI changed the title [WIP] Add retry number to notification and delay Add retry count tracking with exponential backoff Feb 14, 2026
Copilot AI requested a review from Billos February 14, 2026 22:12
@Billos Billos closed this Feb 16, 2026
@Billos
Billos deleted the copilot/add-retry-notification-feature branch February 16, 2026 08:43
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