Skip to main content

retry_utils

General retry utilities.

Module

Functions

compute_backoff

def compute_backoff(    retry_count: int, backoff_factor: int = 1, max_backoff: int = 60,)> int:

Computes the backoff time for a retry.

Backoff is increased using standard exponential backoff formula For standard backoff factor of one this results in backoffs of [1, 2, 4, 8, ...] seconds.

Arguments

  • retry_count: The number of retries attempted.
  • backoff_factor: The backoff factor to use.
  • max_backoff: The maximum backoff time.

Returns The backoff time.