Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 | 3x 3x 3x | import axios from "axios";
import { retry } from "./retry";
export async function axiosGetWithRetries<T>(args: {
url: string;
retryLimit: number;
retryDelayMilliseconds?: number;
timeout?: number;
}): Promise<T> {
return (await retry({
fn: async () => await axios.get(args.url, { timeout: args.timeout }),
fnName: `axios.get`,
maxRetries: args.retryLimit,
waitBetweenMs: args.retryDelayMilliseconds,
})()) as T;
}
|