Skip to content

Commit

Permalink
Also retry fetch rates call upon 400 http codes
Browse files Browse the repository at this point in the history
  • Loading branch information
maelcaldas committed Jun 8, 2021
1 parent 27af253 commit daa71f8
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions gcf/src/exchange-service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ export async function getRates(ratesEndpointUrl: string, cacheInSeconds: number)
method: 'GET',
agent: new https.Agent({keepAlive: true}),
retryConfig: {
statusCodesToRetry: [[100, 199], [400, 429], [500, 599]],
retry: 5,
onRetryAttempt: (err: GaxiosError) => {console.log(`${err.message} - Retrying... `)},
retryDelay: 100
Expand Down

0 comments on commit daa71f8

Please sign in to comment.