Skip to content

Commit

Permalink
Add try/catch to webhook request
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj committed Jan 9, 2024
1 parent 77d3cf8 commit c29eaed
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions src/server/utils/webhook.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,19 +118,21 @@ export const sendTxWebhook = async (queueIds: string[]): Promise<void> => {
}
}

webhookConfig?.map(async (config) => {
if (!config || !config?.active) {
logger({
service: "server",
level: "debug",
message: "No webhook set or active, skipping webhook send",
});

return;
}

await sendWebhookRequest(config, txData);
});
await Promise.all(
webhookConfig?.map(async (config) => {
if (!config || !config?.active) {
logger({
service: "server",
level: "debug",
message: "No webhook set or active, skipping webhook send",
});

return;
}

await sendWebhookRequest(config, txData);
}) || [],
);
}
}
} catch (error) {
Expand Down

0 comments on commit c29eaed

Please sign in to comment.