Fixes #130. Any warning or error from gopsutil was preventing any temps from being displayed, even if some had useful data.
This commit is contained in:
parent
c5a8d0f32f
commit
3d00d349c6
|
@ -2,6 +2,7 @@
|
|||
|
||||
package devices
|
||||
|
||||
// TODO gopsutil is at v3, and we're using v2. See if v3 is released and upgrade if so.
|
||||
import "github.com/shirou/gopsutil/cpu"
|
||||
|
||||
func CpuCount() (int, error) {
|
||||
|
|
|
@ -3,6 +3,7 @@
|
|||
package devices
|
||||
|
||||
import (
|
||||
"log"
|
||||
"strings"
|
||||
|
||||
"github.com/shirou/gopsutil/host"
|
||||
|
@ -15,9 +16,12 @@ func devs() []string {
|
|||
}
|
||||
sensors, err := host.SensorsTemperatures()
|
||||
if err != nil {
|
||||
// FIXME report the error
|
||||
log.Printf("gopsutil reports %s", err)
|
||||
if len(sensors) == 0 {
|
||||
log.Printf("no temperature sensors returned")
|
||||
return []string{}
|
||||
}
|
||||
}
|
||||
rv := make([]string, 0, len(sensors))
|
||||
for _, sensor := range sensors {
|
||||
label := sensor.SensorKey
|
||||
|
|
Loading…
Reference in New Issue
Block a user