Commit 32d7e3cb authored by nanahira's avatar nanahira

fix

parent b9ab979a
"use strict"; "use strict";
Object.defineProperty(exports, "__esModule", { value: true }); Object.defineProperty(exports, "__esModule", { value: true });
exports.retry = retry; exports.retry = retry;
async function retry(fn, count, delayFn = (attempt) => Math.pow(2, attempt) * 1000) { async function retry(fn, count, delayFn = (attempt) => Math.pow(2, attempt) * 100) {
let lastError; let lastError;
for (let attempt = 0; attempt < count; attempt++) { for (let attempt = 0; attempt < count; attempt++) {
try { try {
......
export async function retry<T>( export async function retry<T>(
fn: () => Promise<T>, fn: () => Promise<T>,
count: number, count: number,
delayFn: (attempt: number) => number = (attempt) => Math.pow(2, attempt) * 1000 delayFn: (attempt: number) => number = (attempt) => Math.pow(2, attempt) * 100
): Promise<T> { ): Promise<T> {
let lastError: any; let lastError: any;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment