UNPKG

1.19 kBJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.rapidRetryPolicy = exports.fiveRetriesInFiveMinutes = exports.tenRetriesInAboutThirtyMinutes = void 0;
4/**
5 * The default retry policy. Retry up to 10 times, over the span of about 30 minutes. It's not exact because
6 * randomization has been added to prevent a stampeding herd problem (if all instances in your application are retrying
7 * a request at the exact same intervals, they are more likely to cause failures for each other).
8 */
9exports.tenRetriesInAboutThirtyMinutes = {
10 retries: 10,
11 factor: 1.96821,
12 randomize: true,
13};
14/**
15 * Short & sweet, five retries in five minutes and then bail.
16 */
17exports.fiveRetriesInFiveMinutes = {
18 retries: 5,
19 factor: 3.86,
20};
21/**
22 * This policy is just to keep the tests running fast.
23 */
24exports.rapidRetryPolicy = {
25 minTimeout: 0,
26 maxTimeout: 1,
27};
28const policies = {
29 tenRetriesInAboutThirtyMinutes: exports.tenRetriesInAboutThirtyMinutes,
30 fiveRetriesInFiveMinutes: exports.fiveRetriesInFiveMinutes,
31 rapidRetryPolicy: exports.rapidRetryPolicy,
32};
33exports.default = policies;
34//# sourceMappingURL=retry-policies.js.map
\No newline at end of file