fix: SYS_SENSORS context error (#643)

This commit is contained in:
henrygd
2025-03-06 05:36:20 -05:00
parent a6daa70010
commit d25c7c58c1

View File

@@ -33,6 +33,7 @@ type Agent struct {
func NewAgent() *Agent {
agent := &Agent{
sensorsContext: context.Background(),
fsStats: make(map[string]*system.FsStats),
cache: NewSessionCache(69 * time.Second),
}
@@ -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