aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-16 00:18:13 -0400
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2020-07-16 00:18:13 -0400
commit8dd20026ddd5a9317d5a0b35483c81187bb0c795 (patch)
treefa6d8d15aeaf22867d2c1fc67cf6192cb59ec6da
parent48f03e79f1cefb44652bf201916985952c9f7b62 (diff)
downloadgrokmirror-8dd20026ddd5a9317d5a0b35483c81187bb0c795.tar.gz
Tweak when we repack and not
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-xgrokmirror/pull.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/grokmirror/pull.py b/grokmirror/pull.py
index 486d3ca..97e35d2 100755
--- a/grokmirror/pull.py
+++ b/grokmirror/pull.py
@@ -323,13 +323,13 @@ def pull_worker(config, q_pull, q_diet, q_done):
# This was the initial clone, so pack all refs
diet_actions.append('packrefs-all')
else:
- diet_actions.append('packrefs')
if not grokmirror.is_precious(fullpath):
# See if doing a quick repack would be beneficial
obj_info = grokmirror.get_repo_obj_info(fullpath)
if grokmirror.get_repack_level(obj_info):
# We only do quick repacks, so we don't care about precise level
diet_actions.append('repack')
+ diet_actions.append('packrefs')
modified = repoinfo.get('modified')
if modified is not None:
@@ -341,6 +341,8 @@ def pull_worker(config, q_pull, q_diet, q_done):
diet_actions.append('objstore')
diet_actions.append('repack')
+ grokmirror.unlock_repo(fullpath)
+
symlinks = repoinfo.get('symlinks')
if os.path.exists(fullpath) and symlinks:
for symlink in symlinks:
@@ -364,7 +366,6 @@ def pull_worker(config, q_pull, q_diet, q_done):
os.makedirs(os.path.dirname(target))
os.symlink(fullpath, target)
- grokmirror.unlock_repo(fullpath)
q_done.put((gitdir, repoinfo, q_action, success))
if diet_actions:
q_diet.put((gitdir, diet_actions))
@@ -926,7 +927,7 @@ def showstats(q_todo, q_pull, q_diet, good, bad, pws, dws):
stats.append('%s queued' % q_pull.qsize())
if not q_todo.empty():
stats.append('%s waiting' % q_todo.qsize())
- if not q_diet.empty():
+ if len(dws) or not q_diet.empty():
stats.append('%s dieting' % (q_diet.qsize() + len(dws)))
if bad:
stats.append('%s failed' % bad)