Skip to content

Commit 5a1c7ce

Browse files
authored
Add try/catch to webhook request (#367)
1 parent 77d3cf8 commit 5a1c7ce

File tree

1 file changed

+15
-13
lines changed

1 file changed

+15
-13
lines changed

src/server/utils/webhook.ts

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -118,19 +118,21 @@ export const sendTxWebhook = async (queueIds: string[]): Promise<void> => {
118118
}
119119
}
120120

121-
webhookConfig?.map(async (config) => {
122-
if (!config || !config?.active) {
123-
logger({
124-
service: "server",
125-
level: "debug",
126-
message: "No webhook set or active, skipping webhook send",
127-
});
128-
129-
return;
130-
}
131-
132-
await sendWebhookRequest(config, txData);
133-
});
121+
await Promise.all(
122+
webhookConfig?.map(async (config) => {
123+
if (!config || !config?.active) {
124+
logger({
125+
service: "server",
126+
level: "debug",
127+
message: "No webhook set or active, skipping webhook send",
128+
});
129+
130+
return;
131+
}
132+
133+
await sendWebhookRequest(config, txData);
134+
}) || [],
135+
);
134136
}
135137
}
136138
} catch (error) {

0 commit comments

Comments
 (0)