File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -309,7 +309,7 @@ async function fetchExchangeRates(
309309 }
310310
311311 const requests = convertToRatesParams ( cryptoPairMap , fiatPairMap )
312- for ( const query of requests ) {
312+ const promises = requests . map ( async query => {
313313 const options = {
314314 method : 'POST' ,
315315 headers : { 'Content-Type' : 'application/json' } ,
@@ -399,14 +399,14 @@ async function fetchExchangeRates(
399399
400400 rateObj . expiration = rateExpiration
401401 }
402- break
403402 }
404403 } catch ( error : unknown ) {
405404 console . log (
406405 `buildExchangeRates error querying rates server ${ String ( error ) } `
407406 )
408407 }
409- }
408+ } )
409+ await Promise . allSettled ( promises )
410410
411411 // Update the in-memory cache:
412412 exchangeRateCache = {
You can’t perform that action at this time.
0 commit comments