From 7cfcbf424f923795a27fdb1a4b572cfdd430b2f1 Mon Sep 17 00:00:00 2001 From: Ruben Ruiz de Gauna Date: Mon, 10 Feb 2025 14:27:00 +0100 Subject: [PATCH] feat: retry if deb mirror update fails --- publisher/upload/upload.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/publisher/upload/upload.go b/publisher/upload/upload.go index a0e2956..e018157 100644 --- a/publisher/upload/upload.go +++ b/publisher/upload/upload.go @@ -346,9 +346,10 @@ func mirrorAPTRepo(conf config.Config, repoUrl string, osVersion string) (err er utils.Logger.Printf("[✔] Mirror create succesfully APT repo for %s", osVersion) utils.Logger.Printf("[ ] Mirror update APT repo for %s", osVersion) - if err = utils.ExecLogOutput(utils.Logger, "aptly", commandTimeout, "mirror", "update", "-max-tries", strconv.Itoa(s3Retries), "-keyring", conf.GpgKeyRing, "mirror-"+osVersion); err != nil { + if err = utils.ExecWithRetries(s3Retries, utils.S3RemountFn, utils.Logger, "aptly", commandTimeout, "mirror", "update", "-max-tries", strconv.Itoa(s3Retries), "-keyring", conf.GpgKeyRing, "mirror-"+osVersion); err != nil { return err } + utils.Logger.Printf("[✔] Mirror update succesfully APT repo for %s", osVersion) // The last parameter is `Name` that means a query matches all the packages (as it means “package name is not empty”).