Change the cpu usage interval from second to minute (#2729)

feature(check_cpu_usage): Change the usage interval from second to minute
This commit is contained in:
UltraMegaPotato 2025-03-06 22:38:58 +03:00 committed by GitHub
parent 361849b9db
commit cf7fec1351
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -23,7 +23,7 @@ func (j *CheckCpuJob) Run() {
threshold, _ := j.settingService.GetTgCpu()
// get latest status of server
percent, err := cpu.Percent(1*time.Second, false)
percent, err := cpu.Percent(1*time.Minute, false)
if err == nil && percent[0] > float64(threshold) {
msg := j.tgbotService.I18nBot("tgbot.messages.cpuThreshold",
"Percent=="+strconv.FormatFloat(percent[0], 'f', 2, 64),