Skip to content

Commit

Permalink
Merge pull request #372 from Uniswap/allsettled
Browse files Browse the repository at this point in the history
fix: log allSettled return value
  • Loading branch information
ConjunctiveNormalForm authored Aug 28, 2024
2 parents 443eb84 + 019b155 commit 2471fe5
Showing 1 changed file with 9 additions and 10 deletions.
19 changes: 9 additions & 10 deletions lib/quoters/WebhookQuoter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,9 @@ export class WebhookQuoter implements Quoter {
const quotes = await Promise.all(enabledEndpoints.map((e) => this.fetchQuote(e, request)));

// should not await and block
Promise.allSettled(disabledEndpoints.map((e) => this.notifyBlock(e)));
Promise.allSettled(disabledEndpoints.map((e) => this.notifyBlock(e))).then((results) => {
this.log.info({ results }, 'Notified disabled endpoints');
});

return quotes.filter((q) => q !== null) as QuoteResponse[];
}
Expand Down Expand Up @@ -312,20 +314,17 @@ export class WebhookQuoter implements Quoter {
timeout: NOTIFICATION_TIMEOUT_MS,
...(!!status.webhook.headers && { headers: status.webhook.headers }),
};
try {
axios.post(
axios
.post(
status.webhook.endpoint,
{
blockUntilTimestamp: status.blockUntil,
},
axiosConfig
);
} catch (e) {
this.log.error(
{ endpoint: status.webhook.endpoint, error: e },
`Error notifying block to ${status.webhook.endpoint}`
);
}
)
.catch((e) => {
this.log.error({ endpoint: status.webhook.endpoint, error: e }, `Axios error notifying block`);
});
}
}

Expand Down

0 comments on commit 2471fe5

Please sign in to comment.