Skip to content

Instantly share code, notes, and snippets.

View damianmcdonald's full-sized avatar

Damian McDonald damianmcdonald

View GitHub Profile
@damianmcdonald
damianmcdonald / retry_utils.py
Created January 14, 2024 12:40
Python helper functions for implementing retry with exponential backoff and custom error checking
class RetryUtils():
"""
Provides helper functions for implementing retry with exponential backoff.
"""
def retry_with_backoff(
function: Callable,
function_args: list[Any],
allowed_exceptions: list[str] = [],
retries: int=5,