From 39268c754a1d87b13bc1b8e98d2446e7db85632a Mon Sep 17 00:00:00 2001 From: jvoisin Date: Tue, 22 Dec 2020 11:59:09 +0100 Subject: [PATCH] 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 --- internal/home/controlupdate.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/internal/home/controlupdate.go b/internal/home/controlupdate.go index dcf428b9..9e69617c 100644 --- a/internal/home/controlupdate.go +++ b/internal/home/controlupdate.go @@ -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