From 1447adad1b92a17fcc2bb699c88532fd7c290607 Mon Sep 17 00:00:00 2001 From: WebStreamr <210764791+webstreamr@users.noreply.github.com> Date: Fri, 23 May 2025 09:08:20 +0000 Subject: [PATCH] chore: reduce axios retries to 1 again, avoid risky retries --- src/index.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/index.ts b/src/index.ts index f28c3ed..1de3510 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,7 @@ import express, { NextFunction, Request, Response } from 'express'; import { v4 as uuidv4 } from 'uuid'; -import axios, { AxiosError } from 'axios'; -import axiosRetry, { isNetworkOrIdempotentRequestError } from 'axios-retry'; +import axios from 'axios'; +import axiosRetry from 'axios-retry'; import { setupCache } from 'axios-cache-interceptor'; import winston from 'winston'; import { @@ -32,9 +32,7 @@ const logger = winston.createLogger({ setupCache(axios); axiosRetry(axios, { - retries: 3, - retryDelay: axiosRetry.exponentialDelay, - retryCondition: (error: AxiosError) => isNetworkOrIdempotentRequestError(error) || (error.response?.status ?? 0) > 400, + retries: 1, }); const fetcher = new Fetcher(axios, logger);