Skip to content

Commit f6b291c

Browse files
committed
fix: regenerate manifest after initial lore list clone (CM-1318)
Signed-off-by: Uroš Marolt <uros@marolt.me>
1 parent 212875a commit f6b291c

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

  • services/apps/mailing_list_integration/src/crowdmail/services/mirror

services/apps/mailing_list_integration/src/crowdmail/services/mirror/mirror_service.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,14 @@ async def ensure_mirror(list_name: str, mirror_dir: str = LORE_MIRROR_DIR) -> st
9090
await _run_shell_command(
9191
["public-inbox-clone", "-q", f"--include=/{list_name}", LORE_BASE_URL, mirror_dir]
9292
)
93+
# public-inbox-clone drops a manifest scoped to the whole clone dir,
94+
# not the list; remove it and re-fetch from inside list_dir so the
95+
# manifest is regenerated correctly there (needed to detect new
96+
# epoch shards, e.g. git/1.git, as the list grows).
97+
manifest_path = os.path.join(mirror_dir, "manifest.js.gz")
98+
if os.path.exists(manifest_path):
99+
os.remove(manifest_path)
100+
await _run_shell_command(["public-inbox-fetch", "-q"], cwd=list_dir)
93101
else:
94102
logger.info(f"Fetching updates for lore list '{list_name}'")
95103
await _run_shell_command(["public-inbox-fetch", "-q", "-C", list_dir, "--exit-code"])

0 commit comments

Comments
 (0)