mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-04-19 21:42:24 +00:00
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:
parent
361849b9db
commit
cf7fec1351
1 changed files with 1 additions and 1 deletions
|
@ -23,7 +23,7 @@ func (j *CheckCpuJob) Run() {
|
||||||
threshold, _ := j.settingService.GetTgCpu()
|
threshold, _ := j.settingService.GetTgCpu()
|
||||||
|
|
||||||
// get latest status of server
|
// 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) {
|
if err == nil && percent[0] > float64(threshold) {
|
||||||
msg := j.tgbotService.I18nBot("tgbot.messages.cpuThreshold",
|
msg := j.tgbotService.I18nBot("tgbot.messages.cpuThreshold",
|
||||||
"Percent=="+strconv.FormatFloat(percent[0], 'f', 2, 64),
|
"Percent=="+strconv.FormatFloat(percent[0], 'f', 2, 64),
|
||||||
|
|
Loading…
Reference in a new issue