Sleep before reading first sensor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Søren Rasmussen 2022-07-29 19:40:24 +02:00
parent 2d5f22e0e8
commit e5e025abde

View file

@ -142,6 +142,8 @@ func readSensors(hub *sentry.Hub) {
hasReadFailure := false
for _, sensor := range sensors {
time.Sleep(50 * time.Millisecond)
t, err := read(sensor.Path)
if err != nil {
hasReadFailure = true
@ -171,8 +173,6 @@ func readSensors(hub *sentry.Hub) {
Set(tw)
metrics.TemperatureSensorReadingStatus.WithLabelValues(sensor.Name, "ok").Inc()
time.Sleep(50 * time.Millisecond)
}
// Throw away reading if any sensor failed