From 5f5bcedab986b7b93b42d30e325feaca7a5ba214 Mon Sep 17 00:00:00 2001 From: Matt Date: Sun, 19 Apr 2026 19:35:42 +0000 Subject: [PATCH] Fix progress regex and SIGHUP/scan_zims race condition - Parse Browsertrix "crawled":N JSON format instead of "N pages" - Add 3s delay between SIGHUP to kiwix-serve and scan_zims() call so the OPDS catalog is reloaded before we query it for linking Co-Authored-By: Claude Opus 4.6 --- lib/scraper_runner.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/scraper_runner.py b/lib/scraper_runner.py index d6b0299..b83f145 100644 --- a/lib/scraper_runner.py +++ b/lib/scraper_runner.py @@ -339,6 +339,9 @@ def _process_job(job, config, stop_event): except Exception as e: logger.warning(f"Job {job_id}: failed to signal kiwix-serve: {e}") + # Wait for kiwix-serve to reload its catalog after SIGHUP + time.sleep(3) + zim_source_id = None try: from .zim_monitor import scan_zims