File tree Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Expand file tree Collapse file tree 1 file changed +15
-3
lines changed Original file line number Diff line number Diff line change @@ -380,9 +380,21 @@ const getPools = async (chain) => {
380380} ;
381381
382382const main = async ( ) => {
383- return Object . keys ( SUBGRAPHS ) . reduce ( async ( acc , chain ) => {
384- return [ ...( await acc ) , ...( await getPools ( chain ) ) ] ;
385- } , Promise . resolve ( [ ] ) ) ;
383+ const chains = Object . keys ( SUBGRAPHS ) ;
384+ const results = await Promise . allSettled (
385+ chains . map ( ( chain ) => getPools ( chain ) )
386+ ) ;
387+
388+ return results . reduce ( ( acc , result , index ) => {
389+ if ( result . status === 'fulfilled' ) {
390+ return acc . concat ( result . value ) ;
391+ }
392+ console . error (
393+ `Notional-v3 subgraph request failed for ${ chains [ index ] } :` ,
394+ result . reason
395+ ) ;
396+ return acc ;
397+ } , [ ] ) ;
386398} ;
387399
388400module . exports = {
You can’t perform that action at this time.
0 commit comments