mirror of
https://github.com/fankes/beszel.git
synced 2025-10-20 02:09:28 +08:00
fix: SYS_SENSORS context error (#643)
This commit is contained in:
@@ -33,8 +33,9 @@ type Agent struct {
|
|||||||
|
|
||||||
func NewAgent() *Agent {
|
func NewAgent() *Agent {
|
||||||
agent := &Agent{
|
agent := &Agent{
|
||||||
fsStats: make(map[string]*system.FsStats),
|
sensorsContext: context.Background(),
|
||||||
cache: NewSessionCache(69 * time.Second),
|
fsStats: make(map[string]*system.FsStats),
|
||||||
|
cache: NewSessionCache(69 * time.Second),
|
||||||
}
|
}
|
||||||
agent.memCalc, _ = GetEnv("MEM_CALC")
|
agent.memCalc, _ = GetEnv("MEM_CALC")
|
||||||
|
|
||||||
@@ -59,8 +60,6 @@ func NewAgent() *Agent {
|
|||||||
agent.sensorsContext = context.WithValue(agent.sensorsContext,
|
agent.sensorsContext = context.WithValue(agent.sensorsContext,
|
||||||
common.EnvKey, common.EnvMap{common.HostSysEnvKey: sysSensors},
|
common.EnvKey, common.EnvMap{common.HostSysEnvKey: sysSensors},
|
||||||
)
|
)
|
||||||
} else {
|
|
||||||
agent.sensorsContext = context.Background()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set sensors whitelist
|
// Set sensors whitelist
|
||||||
|
Reference in New Issue
Block a user