From 128730d788222be2aaed6508a73575c37a0041e6 Mon Sep 17 00:00:00 2001 From: miao_kaibo Date: Tue, 12 Jan 2021 19:06:40 +0800 Subject: [PATCH] add try for copy --- core/update_obs_repos.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/core/update_obs_repos.py b/core/update_obs_repos.py index 3bd575c..73d957a 100755 --- a/core/update_obs_repos.py +++ b/core/update_obs_repos.py @@ -205,10 +205,16 @@ class RPMManager(object): self.backup_old_rpms_by_pkg(pkg, new_rpms_list) else: log.debug("%s all rpms are latest should do nothing" % pkg) - if not self.rpms_exists(new_rpms_list): - self.copy_new_rpms_to_repo(pkg, new_rpms_list) - else: - log.debug("%s all rpms exists, should do nothing" % pkg) + for i in range(5): + try: + if not self.rpms_exists(new_rpms_list): + log.debug("check %s rpms not exists, shoud copy again" % pkg) + self.copy_new_rpms_to_repo(pkg, new_rpms_list) + else: + log.debug("check %s all rpms exists" % pkg) + break + except Exception as e: + log.error(e) def update_pkgs(self): """ -- Gitee