Skip to content

Commit e44cadd

Browse files
committed
feat: add disable alarm environment variable value
1 parent 63c5d11 commit e44cadd

2 files changed

Lines changed: 7 additions & 0 deletions

File tree

config/config.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -297,6 +297,10 @@ func parseAlarmOnConfig(cfg *MainConf) {
297297
}
298298
}
299299

300+
if cfg.LogConf.AlarmCode == AlarmDisabledValue {
301+
cfg.LogConf.AlarmCode = ""
302+
}
303+
300304
AlarmOn.Store(cfg.LogConf.PostAlarmAPI != "" && cfg.LogConf.AlarmCode != "")
301305
}
302306

config/default.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ var (
111111

112112
// ServiceNameSuffix systemctl 服务名后缀 (Ubuntu)
113113
ServiceNameSuffix = ".service"
114+
115+
// AlarmDisabledValue 禁用报警标识
116+
AlarmDisabledValue = "--disabled"
114117
)
115118

116119
var (

0 commit comments

Comments
 (0)