From caaa8c9f66a1fd84315db628011b838bca4ea67e Mon Sep 17 00:00:00 2001 From: clover caruso Date: Sat, 17 Oct 2026 02:57:38 -0700 Subject: [PATCH] Derive Zig mirror lock paths at use --- service/zig-mirror/build/mirror.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/service/zig-mirror/build/mirror.py b/service/zig-mirror/build/mirror.py index adc499a267fe8ed11865df43825ccc6b70521dc3..38771870ba1b1c84c3464f810be5da863b8dd105 100644 --- a/service/zig-mirror/build/mirror.py +++ b/service/zig-mirror/build/mirror.py @@ -89,7 +89,6 @@ class Mirror: def __init__(self, root): self.root = Path(root) self.root.mkdir(parents=True, exist_ok=True) - self.locks = self.root / '.mirror-locks' self.slots = threading.BoundedSemaphore(4) self.refresh_lock = threading.Lock() @@ -110,8 +109,9 @@ class Mirror: try: if shutil.disk_usage(self.root).free < 16 * 1024**3: raise Unavailable('mirror free-space reserve reached') - self.locks.mkdir(exist_ok=True) - with (self.locks / artifact_name).open('a') as lock: + locks = self.root / '.mirror-locks' + locks.mkdir(exist_ok=True) + with (locks / artifact_name).open('a') as lock: fcntl.flock(lock, fcntl.LOCK_EX) if target.is_file(): return target -- 2.54.1