use NotifyRepeatNext as TriggerTime when repeat notify

This commit is contained in:
Ulric Qin 2021-12-15 18:37:48 +08:00
parent 95ebc44f05
commit 0f3bbf6368
3 changed files with 13 additions and 3 deletions

View File

@ -2,7 +2,7 @@
NOW = $(shell date -u '+%Y%m%d%I%M%S')
RELEASE_VERSION = 5.0.0-ga-06
RELEASE_VERSION = 5.1.0
APP = n9e
SERVER_BIN = $(APP)

View File

@ -79,7 +79,7 @@ services:
- "server"
nwebapi:
image: ulric2019/nightingale:5.0.0-ga-06
image: ulric2019/nightingale:5.1.0
container_name: nwebapi
hostname: nwebapi
restart: always
@ -107,7 +107,7 @@ services:
- "webapi"
nserver:
image: ulric2019/nightingale:5.0.0-ga-06
image: ulric2019/nightingale:5.1.0
container_name: nserver
hostname: nserver
restart: always

View File

@ -48,6 +48,14 @@ func repeat() {
event.DB2Mem()
// 重复通知的告警,应该用新的时间来判断是否生效和是否屏蔽,
// 不能使用TriggerTime因为TriggerTime是触发时的时间
// 先发了告警又做了屏蔽本质是不想发了如果继续用TriggerTime判断
// 就还是会发不符合预期所以这里伪装一下TriggerTime
// 判断完了再卸掉伪装
realTriggerTime := event.TriggerTime
event.TriggerTime = event.NotifyRepeatNext
if isNoneffective(event.TriggerTime, rule) {
continue
}
@ -56,6 +64,8 @@ func repeat() {
continue
}
event.TriggerTime = realTriggerTime
fillUsers(event)
notify(event)