Skip to content

Commit 0ed4fc2

Browse files
committed
2 parents 0ccc5d1 + cd8aaa1 commit 0ed4fc2

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

notifications.go

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,14 @@ func CreateOrgNotification(ctx context.Context, title, description, referenceUrl
808808
if mainNotification.Ignored {
809809
log.Printf("[INFO] Ignored notification %s for %s", mainNotification.Title, mainNotification.UserId)
810810
} else {
811-
err = sendToNotificationWorkflow(ctx, mainNotification, selectedApikey, org.Defaults.NotificationWorkflow, false, *authOrg)
812-
if err != nil {
813-
if !strings.Contains(err.Error(), "cache stored") && !strings.Contains(err.Error(), "Same workflow") {
814-
log.Printf("[ERROR] Failed sending notification to workflowId %s for reference %s (2): %s", org.Defaults.NotificationWorkflow, mainNotification.Id, err)
811+
go func() {
812+
err = sendToNotificationWorkflow(ctx, mainNotification, selectedApikey, org.Defaults.NotificationWorkflow, false, *authOrg)
813+
if err != nil {
814+
if !strings.Contains(err.Error(), "cache stored") && !strings.Contains(err.Error(), "Same workflow") {
815+
log.Printf("[ERROR] Failed sending notification to workflowId %s for reference %s (2): %s", org.Defaults.NotificationWorkflow, mainNotification.Id, err)
816+
}
815817
}
816-
}
818+
}()
817819
}
818820

819821
return nil
@@ -910,10 +912,12 @@ func CreateOrgNotification(ctx context.Context, title, description, referenceUrl
910912
}
911913
}
912914

913-
err = sendToNotificationWorkflow(ctx, mainNotification, selectedApikey, org.Defaults.NotificationWorkflow, false, *authOrg)
914-
if err != nil {
915-
log.Printf("[ERROR] Failed sending notification to workflowId %s for reference %s: %s", org.Defaults.NotificationWorkflow, mainNotification.Id, err)
916-
}
915+
go func() {
916+
err = sendToNotificationWorkflow(ctx, mainNotification, selectedApikey, org.Defaults.NotificationWorkflow, false, *authOrg)
917+
if err != nil {
918+
log.Printf("[ERROR] Failed sending notification to workflowId %s for reference %s: %s", org.Defaults.NotificationWorkflow, mainNotification.Id, err)
919+
}
920+
}()
917921
}
918922
}
919923

0 commit comments

Comments
 (0)