-
Notifications
You must be signed in to change notification settings - Fork 69
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor(notifier): rescheduling delay #1046
refactor(notifier): rescheduling delay #1046
Conversation
At notifier/scheduler.go inside StandardScheduler.ScheduleNotification on sending fail the next scheduling time was always now + 1 minute. Now you can change this 1 minute to some other value. Also, the ScheduleNotification interface had many params, so struct notifier.SchedulerParams is now used.
Because of using new struct as a scheduler params and new configurable value tests and test data should be corrected
Because of using new struct as a scheduler params and new configurable value tests and test data should be corrected
…sko/moira into refactor/rescheduling-delay
If delay time is the same as rescheduling delay then delayed notifications may not be considered delayed
@@ -94,15 +96,16 @@ func getDefault() config { | |||
NotificationHistoryQueryLimit: int(notifier.NotificationsLimitUnlimited), | |||
}, | |||
Notification: cmd.NotificationConfig{ | |||
DelayedTime: "1m", | |||
DelayedTime: "50s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
А почему решил поменять тут значение по умолчанию?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
К задаче прикреплено обсуждение по этому поводу. Получается если DelayedTime == ReschedulingDelay
, то ScheduledNotification не считается отложенной (delayed) тык.
Ну и также поменял данное значение в local/notifier.yml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Обсуждение прочитал, но может логичнее условие сделать строгим, вместо того, чтобы время костылить с 60 на 50 секунд?
Previous commit has problems with tests in database/redis
/build |
Build and push Docker images with tag: refactor-rescheduling-delay.2024-07-11.1513373 |
2aa786d
into
moira-alert:refactor/rescheduling-delay
Authored-by: Aleksandr Matsko (@AleksandrMatsko)
Configurable rescheduling delay in notifier
On failured sending notifier scheduled another notification on
time.Now() + 1 minute
. Now this additional time can be configured.