Use a simple backoff for retrying the update

- Not sleeping might be too fast for the DNS server to restart
- Fix the link to the issue
This commit is contained in:
jvoisin 2020-12-22 11:59:09 +01:00 committed by Ainar Garipov
parent 9fb6bf82c7
commit 39268c754a
1 changed files with 3 additions and 1 deletions

View File

@ -9,6 +9,7 @@ import (
"runtime"
"strings"
"syscall"
"time"
"github.com/AdguardTeam/AdGuardHome/internal/sysutil"
"github.com/AdguardTeam/AdGuardHome/internal/update"
@ -46,7 +47,8 @@ func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
Context.controlLock.Unlock()
if err != nil && strings.HasSuffix(err.Error(), "i/o timeout") {
// This case may happen while we're restarting DNS server
// https://github.com/AdguardTeam/AdGuardHome/internal/issues/934
// https://github.com/AdguardTeam/AdGuardHome/issues/934
time.Sleep(time.Duration(i) * time.Second)
continue
}
break