From cc74a67c0968dcb9cef830b676855dd5a1cdec42 Mon Sep 17 00:00:00 2001 From: Konstantin Ryabitsev Date: Thu, 5 Nov 2020 18:02:49 -0500 Subject: Don't leave .bundle files around If the connection is reset and we fail to download the entire bundle file, make sure to delete it. Future work: perhaps have support for resuming downloads... Signed-off-by: Konstantin Ryabitsev --- grokmirror/pull.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/grokmirror/pull.py b/grokmirror/pull.py index 162d3e8..238d73d 100755 --- a/grokmirror/pull.py +++ b/grokmirror/pull.py @@ -360,6 +360,11 @@ def pull_worker(config, q_pull, q_spa, q_done): try: objstore_repo_preload(config, obstrepo) except: # noqa + logger.info(' objstore: not able to preload, will clone repo-by-repo') + # Make sure we don't leave .bundle files trailing around + bfile = obstrepo[:-4] + '.bundle' + if os.path.exists(bfile): + os.unlink(bfile) pass if r_fp != my_fp: -- cgit 1.2.3-korg