Made "notification:send" action idempotent
Signed-off-by: Bogdan Nechyporenko <bnechyporenko@bol.com>
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-scaffolder-backend-module-notifications': patch
|
||||
---
|
||||
|
||||
Made "notification:send" action idempotent
|
||||
@@ -133,9 +133,14 @@ export function createSendNotificationAction(options: {
|
||||
};
|
||||
|
||||
try {
|
||||
await notifications.send({
|
||||
recipients: notificationRecipients,
|
||||
payload,
|
||||
await ctx.checkpoint({
|
||||
key: `send.notification.${payload.title}`,
|
||||
fn: async () => {
|
||||
await notifications.send({
|
||||
recipients: notificationRecipients,
|
||||
payload,
|
||||
});
|
||||
},
|
||||
});
|
||||
} catch (e) {
|
||||
ctx.logger.error(`Failed to send notification: ${e}`);
|
||||
|
||||
Reference in New Issue
Block a user