Fix temperatures not showing (#101, #103)

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:
Caleb Bassi 2019-02-03 20:11:28 -08:00
parent 95b6665026
commit dbf25cdd85

View File

@ -13,8 +13,7 @@ import (
func (self *Temp) update() {
sensors, err := psHost.SensorsTemperatures()
if err != nil {
log.Printf("failed to get sensors from gopsutil: %v", err)
return
log.Printf("error recieved from gopsutil: %v", err)
}
for _, sensor := range sensors {
// only sensors with input in their name are giving us live temp info