Options
All
  • Public
  • Public/Protected
  • All
Menu

Module retry

Index

Functions Async

Async Functions

  • retry<T>(runner: T, maxRetryCount?: number, retryAfterMSecond?: number): T
  • make function retry-able

    e.g. if maxRetryCount is 3, it will run 3 times at most (include the first one), and return the final error.

    since

    5.14.0

    Type Parameters

    • T

    Parameters

    • runner: T

      async function, return promise

    • maxRetryCount: number = 3

      the maximum number of times a runner should retry, default is 3

    • retryAfterMSecond: number = 0

      (async function required, for sync function, this parameter will not be applied) the wait milliseconds before retry, default is zero

    Returns T