diff --git a/beszel/internal/agent/agent.go b/beszel/internal/agent/agent.go index 53f00b1..32cba0e 100644 --- a/beszel/internal/agent/agent.go +++ b/beszel/internal/agent/agent.go @@ -33,8 +33,9 @@ type Agent struct { func NewAgent() *Agent { agent := &Agent{ - fsStats: make(map[string]*system.FsStats), - cache: NewSessionCache(69 * time.Second), + sensorsContext: context.Background(), + fsStats: make(map[string]*system.FsStats), + cache: NewSessionCache(69 * time.Second), } agent.memCalc, _ = GetEnv("MEM_CALC") @@ -59,8 +60,6 @@ func NewAgent() *Agent { agent.sensorsContext = context.WithValue(agent.sensorsContext, common.EnvKey, common.EnvMap{common.HostSysEnvKey: sysSensors}, ) - } else { - agent.sensorsContext = context.Background() } // Set sensors whitelist