Skip to content

refactor: improve device activity polling with exponential backoff#35

Merged
kaincenteno merged 1 commit into
mainfrom
refactor-backoff
Jul 12, 2026
Merged

refactor: improve device activity polling with exponential backoff#35
kaincenteno merged 1 commit into
mainfrom
refactor-backoff

Conversation

@kaincenteno

Copy link
Copy Markdown
Owner

Replace the linear polling in _wait_for_device_activity_completion with exponential backoff and extract magic numbers into parameters.

  • Remove unconditional 10s sleep before the first status check
  • Switch from linear 10 * (retry + 1) to exponential 2 ** (retry + 1) backoff: 2s → 4s → 8s → 16s → 32s (62s total, down from 150s)
  • Add backoff_factor and max_retries keyword parameters with sensible defaults for configurability

Replace the linear polling in `_wait_for_device_activity_completion`
with exponential backoff and extract magic numbers into parameters.

- Remove unconditional 10s sleep before the first status check
- Switch from linear `10 * (retry + 1)` to exponential `2 ** (retry + 1)`
  backoff: 2s → 4s → 8s → 16s → 32s (62s total, down from 150s)
- Add `backoff_factor` and `max_retries` keyword parameters with
  sensible defaults for configurability
@kaincenteno kaincenteno merged commit 81055c5 into main Jul 12, 2026
1 check 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.

1 participant