diff --git a/packages/connectivity/src/scp-cf/destination/destination-service.ts b/packages/connectivity/src/scp-cf/destination/destination-service.ts index 187d27c31c..c6f007e269 100644 --- a/packages/connectivity/src/scp-cf/destination/destination-service.ts +++ b/packages/connectivity/src/scp-cf/destination/destination-service.ts @@ -4,11 +4,10 @@ import { propertyExists, removeTrailingSlashes } from '@sap-cloud-sdk/util'; -// eslint-disable-next-line import/named import axios from 'axios'; import { executeWithMiddleware } from '@sap-cloud-sdk/resilience/internal'; import { resilience } from '@sap-cloud-sdk/resilience'; -import * as asyncRetry from 'async-retry'; +import asyncRetry from 'async-retry'; import { decodeJwt, getTenantId, wrapJwtInHeader } from '../jwt'; import { urlAndAgent } from '../../http-agent'; import { buildAuthorizationHeaders } from '../authorization-header'; @@ -313,7 +312,7 @@ function retryDestination( > { return options => arg => { let retryCount = 1; - return asyncRetry.default( + return asyncRetry( async bail => { try { const destination = await options.fn(arg); @@ -340,7 +339,7 @@ function retryDestination( }, { retries: 3, - onRetry: err => + onRetry: (err: Error) => logger.warn( `Failed to retrieve destination ${destinationName} - doing a retry. Original Error ${err.message}` ) diff --git a/packages/resilience/package.json b/packages/resilience/package.json index 1d6b261937..445c7386c7 100644 --- a/packages/resilience/package.json +++ b/packages/resilience/package.json @@ -44,7 +44,7 @@ "opossum": "^8.1.4" }, "devDependencies": { - "@types/async-retry": "^1.4.8", + "@types/async-retry": "^1.4.9", "@types/opossum": "^8.1.8", "nock": "^14.0.0-beta.6", "typescript": "~5.6.2" diff --git a/yarn.lock b/yarn.lock index 415818d77d..1ae3955f5c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1635,10 +1635,10 @@ resolved "https://registry.npmjs.org/@tsd/typescript/-/typescript-5.4.5.tgz#a7c11d3a97ddfa201f831f4e4270a169a87f7655" integrity sha512-saiCxzHRhUrRxQV2JhH580aQUZiKQUXI38FcAcikcfOomAil4G4lxT0RfrrKywoAYP/rqAdYXYmNRLppcd+hQQ== -"@types/async-retry@^1.4.8": - version "1.4.8" - resolved "https://registry.npmjs.org/@types/async-retry/-/async-retry-1.4.8.tgz#eb32df13aceb9ba1a8a80e7fe518ff4e3fe46bb3" - integrity sha512-Qup/B5PWLe86yI5I3av6ePGaeQrIHNKCwbsQotD6aHQ6YkHsMUxVZkZsmx/Ry3VZQ6uysHwTjQ7666+k6UjVJA== +"@types/async-retry@^1.4.9": + version "1.4.9" + resolved "https://registry.npmjs.org/@types/async-retry/-/async-retry-1.4.9.tgz#47d118e835864d633b5208a78a6907b1b44e50bc" + integrity sha512-s1ciZQJzRh3708X/m3vPExr5KJlzlZJvXsKpbtE2luqNcbROr64qU+3KpJsYHqWMeaxI839OvXf9PrUSw1Xtyg== dependencies: "@types/retry" "*"