Use api.ErrTimeout only for retryable device communication

This commit is contained in:
andig 2022-06-05 16:02:18 +02:00
parent e97e66a60c
commit ff1cd4150e
5 changed files with 9 additions and 7 deletions

View file

@ -88,7 +88,7 @@ func main() {
for err = api.ErrMustRetry; err != nil && matchesError(err, api.ErrMustRetry); {
if soc, err = v.SoC(); err != nil {
if time.Since(start) > time.Minute {
err = api.ErrTimeout
err = os.ErrDeadlineExceeded
} else {
time.Sleep(5 * time.Second)
}