INNER CODE UNIT · TypeScript

getRetryStrategy

amplify-education/serverless-domain-manager · src/globals.ts:108

  public static getRetryStrategy (attempts: number = 5, delay: number = 3000, backoff: number = 500) {
    return new ConfiguredRetryStrategy(
      attempts, // max attempts.
      // This example sets the backoff at 500ms plus 3s per attempt.
      // https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/modules/_aws_sdk_util_retry.html#aws-sdkutil-retry
      (attempt: number) => backoff + attempt * delay // backoff function.
    );
  }

  public static getRequestHandler () {
    const proxyAgent = new ProxyAgent();
    return new NodeHttpHandler({
      httpAgent: proxyAgent,
      httpsAgent: proxyAgent
    });
  }
}

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…