Don't fail on failure to lock
Instead of failing outright on failure to lock a repo, sleep for 5
seconds and put it back into queue to retry again.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
diff --git a/grokmirror/pull.py b/grokmirror/pull.py
index 77cfa1c..fcd8667 100755
--- a/grokmirror/pull.py
+++ b/grokmirror/pull.py
@@ -256,8 +256,10 @@
try:
grokmirror.lock_repo(fullpath, nonblocking=True)
except IOError:
- # Let the next run deal with this one
- q_done.put((gitdir, repoinfo, q_action, False))
+ # Take a quick nap and put it back into queue
+ logger.info(' defer: %s (locked)', gitdir)
+ time.sleep(5)
+ q_pull.put((gitdir, repoinfo, action, q_action))
continue
if action == 'purge':