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:
parent
9fb6bf82c7
commit
39268c754a
|
@ -9,6 +9,7 @@ import (
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"syscall"
|
"syscall"
|
||||||
|
"time"
|
||||||
|
|
||||||
"github.com/AdguardTeam/AdGuardHome/internal/sysutil"
|
"github.com/AdguardTeam/AdGuardHome/internal/sysutil"
|
||||||
"github.com/AdguardTeam/AdGuardHome/internal/update"
|
"github.com/AdguardTeam/AdGuardHome/internal/update"
|
||||||
|
@ -46,7 +47,8 @@ func handleGetVersionJSON(w http.ResponseWriter, r *http.Request) {
|
||||||
Context.controlLock.Unlock()
|
Context.controlLock.Unlock()
|
||||||
if err != nil && strings.HasSuffix(err.Error(), "i/o timeout") {
|
if err != nil && strings.HasSuffix(err.Error(), "i/o timeout") {
|
||||||
// This case may happen while we're restarting DNS server
|
// 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
|
continue
|
||||||
}
|
}
|
||||||
break
|
break
|
||||||
|
|
Loading…
Reference in New Issue