diff options
author | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-09-28 15:51:40 -0400 |
---|---|---|
committer | Konstantin Ryabitsev <konstantin@linuxfoundation.org> | 2020-09-28 15:51:40 -0400 |
commit | a1415bd959326a6b3a98941f28659b6e930403d5 (patch) | |
tree | d4550124b21da5f3363c91cfeeb5255e14631b8e | |
parent | dd97c2792e4c7d23084ba6207cbf1173df79fa3d (diff) | |
download | grokmirror-a1415bd959326a6b3a98941f28659b6e930403d5.tar.gz |
Allow forcing obstrepo repack
Touch grokmirror.repack to force a full repack of an objstore repository
outside of its usual schedule.
Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rwxr-xr-x | grokmirror/fsck.py | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/grokmirror/fsck.py b/grokmirror/fsck.py index 8b04f15..7f3cf1c 100755 --- a/grokmirror/fsck.py +++ b/grokmirror/fsck.py @@ -1105,7 +1105,11 @@ def fsck_mirror(config, force=False, repack_only=False, conn_only=False, manifest[gitdir]['forkgroup'] = os.path.basename(obstrepo[:-4]) - if obstrepo not in status or new_islandcore: + repack_requested = False + if os.path.exists(os.path.join(obstrepo, 'grokmirror.repack')): + repack_requested = True + + if obstrepo not in status or new_islandcore or repack_requested: # We don't use obstrepo fingerprints, so we set it to None status[obstrepo] = { 'lastcheck': 'never', @@ -1172,6 +1176,11 @@ def fsck_mirror(config, force=False, repack_only=False, conn_only=False, if run_git_repack(fullpath, config, repack_level): status[fullpath]['lastrepack'] = todayiso if repack_level > 1: + try: + os.unlink(os.path.join(fullpath, 'grokmirror.repack')) + except FileNotFoundError: + pass + status[fullpath]['lastfullrepack'] = todayiso status[fullpath]['lastcheck'] = todayiso status[fullpath]['nextcheck'] = nextcheck.strftime('%F') |