chore(cwmp): status log filter

This commit is contained in:
leandrofars 2024-06-09 19:16:59 -03:00
parent d33405675c
commit 2ed2111c52

View File

@ -11,7 +11,9 @@ func (h *Handler) HandleCpeStatus() {
if cpe == "" { if cpe == "" {
continue continue
} }
log.Println("Checking CPE " + cpe + " status") if h.acsConfig.DebugMode {
log.Println("Checking CPE " + cpe + " status")
}
if time.Since(h.Cpes[cpe].LastConnection) > h.acsConfig.KeepAliveInterval { if time.Since(h.Cpes[cpe].LastConnection) > h.acsConfig.KeepAliveInterval {
log.Printf("LastConnection: %s, KeepAliveInterval: %s", h.Cpes[cpe].LastConnection, h.acsConfig.KeepAliveInterval) log.Printf("LastConnection: %s, KeepAliveInterval: %s", h.Cpes[cpe].LastConnection, h.acsConfig.KeepAliveInterval)
log.Println("CPE", cpe, "is offline") log.Println("CPE", cpe, "is offline")
@ -22,4 +24,4 @@ func (h *Handler) HandleCpeStatus() {
} }
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
} }
} }