Skip to content

Commit af15ec9

Browse files
committed
notional-v3 fix
1 parent 6f24ceb commit af15ec9

File tree

1 file changed

+15
-3
lines changed

1 file changed

+15
-3
lines changed

src/adaptors/notional-v3/index.js

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -380,9 +380,21 @@ const getPools = async (chain) => {
380380
};
381381

382382
const 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

388400
module.exports = {

0 commit comments

Comments
 (0)