From 3de23481af7e4b2afe533f6aa7281333101ee8dd Mon Sep 17 00:00:00 2001 From: crebsy <121096251+crebsy@users.noreply.github.com> Date: Mon, 8 Jul 2024 20:08:48 +0200 Subject: [PATCH] fix: retry also if snap url creds can't be retrieved --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index aaba306..198226b 100644 --- a/main.go +++ b/main.go @@ -288,6 +288,11 @@ func downloadoor(index *moonproto.Index, chunkChan chan<- Chunk, downloadChan <- libUrlCreds := getSnapUrlCreds(libName) u, err := url.Parse(libUrlCreds.Url) if err != nil { + retries += 1 + if retries <= MAX_RETRIES { + time.Sleep(1 * time.Second) + goto retry + } panic(err) }