Updates so far

Co-authored-by: MHSanaei <ho3ein.sanaei@gmail.com>
This commit is contained in:
Alireza Ahmadi
2026-02-01 00:51:53 +01:00
parent d1606d1109
commit 6bab6ce6c4
35 changed files with 1021 additions and 297 deletions

View File

@@ -20,7 +20,11 @@ func NewCheckCpuJob() *CheckCpuJob {
// Here run is a interface method of Job interface
func (j *CheckCpuJob) Run() {
threshold, _ := j.settingService.GetTgCpu()
threshold, err := j.settingService.GetTgCpu()
if err != nil || threshold <= 0 {
// If threshold cannot be retrieved or is not set, skip sending notifications
return
}
// get latest status of server
percent, err := cpu.Percent(1*time.Second, false)