Skip to content

Commit

Permalink
feat: add disable alarm environment variable value
Browse files Browse the repository at this point in the history
  • Loading branch information
fufuok committed Aug 14, 2024
1 parent 63c5d11 commit e44cadd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,10 @@ func parseAlarmOnConfig(cfg *MainConf) {
}
}

if cfg.LogConf.AlarmCode == AlarmDisabledValue {
cfg.LogConf.AlarmCode = ""
}

AlarmOn.Store(cfg.LogConf.PostAlarmAPI != "" && cfg.LogConf.AlarmCode != "")
}

Expand Down
3 changes: 3 additions & 0 deletions config/default.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,9 @@ var (

// ServiceNameSuffix systemctl 服务名后缀 (Ubuntu)
ServiceNameSuffix = ".service"

// AlarmDisabledValue 禁用报警标识
AlarmDisabledValue = "--disabled"
)

var (
Expand Down

0 comments on commit e44cadd

Please sign in to comment.