Clean up cputemp.

merlin v1.4r3
Christopher Young 2017-10-10 11:27:15 -04:00
rodzic 2fc134aa38
commit 4de2420803
1 zmienionych plików z 1 dodań i 3 usunięć

Wyświetl plik

@ -19,8 +19,6 @@ and often times reading this file hangs quite some time. */
func cpuTempMonitor(updater CpuTempUpdateFunc) {
timer := time.NewTicker(1 * time.Second)
for {
<-timer.C
// Update CPUTemp.
temp, err := ioutil.ReadFile("/sys/class/thermal/thermal_zone0/temp")
tempStr := strings.Trim(string(temp), "\n")
@ -38,7 +36,7 @@ func cpuTempMonitor(updater CpuTempUpdateFunc) {
if t >= invalidCpuTemp { // Only update if valid value was obtained.
updater(t)
}
<-timer.C
}
}