Skip to content

Commit

Permalink
change retry attempt and sleep duration
Browse files Browse the repository at this point in the history
  • Loading branch information
a7vicky committed Sep 22, 2024
1 parent d719b40 commit ef43c6f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pkg/handlers/webhookreceiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ func (h *WebhookReceiverHandler) processAlert(alert template.Alert, mnl *oav1alp
// Send the servicelog for the alert
log.WithFields(log.Fields{LogFieldNotificationName: notification.Name}).Info("will send servicelog for notification")

var attempts int = 5
var sleep time.Duration = 10
var attempts int = 2
var sleep time.Duration = 300
// Call reattempt with a closure capturing notification, alert, firing, and h.ocm
slerr := reattempt(attempts, sleep, func() error {
return h.sendServiceLog(notification, alert, firing, h.ocm)
Expand Down
2 changes: 1 addition & 1 deletion pkg/handlers/webhookreceiver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -536,7 +536,7 @@ var _ = Describe("Webhook Handlers", func() {
},
}
gomock.InOrder(
mockOCMClient.EXPECT().SendServiceLog(activeServiceLog).Return(k8serrs.NewInternalError(fmt.Errorf("a fake error"))).Times(5),
mockOCMClient.EXPECT().SendServiceLog(activeServiceLog).Return(k8serrs.NewInternalError(fmt.Errorf("a fake error"))).Times(2),
mockClient.EXPECT().Get(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil).SetArg(2, testManagedNotificationList.Items[0]),
mockClient.EXPECT().Status().Return(mockStatusWriter),
mockStatusWriter.EXPECT().Update(gomock.Any(), gomock.Any(), gomock.Any()).Return(nil),
Expand Down

0 comments on commit ef43c6f

Please sign in to comment.