antlir/common.py [278:295]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    format_msg: str,
    delays: Iterable[float],
    *,
    is_exception_retryable: Optional[Callable[[Exception], bool]] = None,
    log_exception: bool = True,
):
    """Decorator used to retry a function if exceptions are thrown. `format_msg`
    should be a format string that can access any args provided to the
    decorated function. `delays` are the delays between retries, in seconds.
    `is_exception_retryable` and `log_exception` are forwarded to `retry_fn`,
    see its docblock.
    """
    # Prevent aliasing, iterator exhaustion, and other weirdness.
    # Indeterminate retry would require changing the API anyway.
    delays = list(delays)

    def wrapper(fn):
        @wraps(fn)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



antlir/common.py [345:362]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    format_msg: str,
    delays: Iterable[float],
    *,
    is_exception_retryable: Optional[Callable[[Exception], bool]] = None,
    log_exception: bool = True,
):
    """Decorator used to retry an asynchronous function if exceptions are
    thrown. `format_msg` should be a format string that can access any args
    provided to the decorated function. `delays` are the delays between
    retries, in seconds. `is_exception_retryable` and `log_exception` are
    forwarded to `async_retry_fn`, see its docblock.
    """
    # Prevent aliasing, iterator exhaustion, and other weirdness.
    # Indeterminate retry would require changing the API anyway.
    delays = list(delays)

    def wrapper(fn):
        @wraps(fn)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



