Sometimes a temperature sensor file in `/sys/class/hwmon/hwmon*/temp*_*` will return 'ENETDOWN: Network is down' when being read for some reason, which gopsutil propogates up to gotop. gopsutil still returns a slice of valid temperatures when it errors, so we can render those instead of ignoring the return value.
This commit is contained in:
parent
95b6665026
commit
dbf25cdd85
|
@ -13,8 +13,7 @@ import (
|
||||||
func (self *Temp) update() {
|
func (self *Temp) update() {
|
||||||
sensors, err := psHost.SensorsTemperatures()
|
sensors, err := psHost.SensorsTemperatures()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("failed to get sensors from gopsutil: %v", err)
|
log.Printf("error recieved from gopsutil: %v", err)
|
||||||
return
|
|
||||||
}
|
}
|
||||||
for _, sensor := range sensors {
|
for _, sensor := range sensors {
|
||||||
// only sensors with input in their name are giving us live temp info
|
// only sensors with input in their name are giving us live temp info
|
||||||
|
|
Loading…
Reference in New Issue
Block a user