Skip to content

Commit

Permalink
Add try/catch to webhook request (#367)
Browse files Browse the repository at this point in the history
  • Loading branch information
adam-maj authored Jan 9, 2024
1 parent 77d3cf8 commit 5a1c7ce
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 5a1c7ce

Please sign in to comment.