From 8b1f6d4a65ff13766e19998ffdf80d28141f49f1 Mon Sep 17 00:00:00 2001 From: inference-bot Date: Tue, 3 Nov 2026 19:40:36 +0000 Subject: [PATCH] docs site: release the deploy lock after each deploy The receiver took the deploy lock but never released it, which starved the poller (flock -n failed instantly on every cycle). --- publishing/webhook-receiver.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/publishing/webhook-receiver.py b/publishing/webhook-receiver.py index cce134c..90c8ae3 100644 --- a/publishing/webhook-receiver.py +++ b/publishing/webhook-receiver.py @@ -107,8 +107,7 @@ def run(cmd, timeout, cwd=None): def deploy(commit_hint=""): """Pull main, rebuild, republish. Returns (ok, log_tail).""" try: - with open("/dev/null") as devnull: - fcntl.flock(deploy_lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB) + fcntl.flock(deploy_lock_file, fcntl.LOCK_EX | fcntl.LOCK_NB) except BlockingIOError: return False, "another deploy is already running; skipped" @@ -133,6 +132,8 @@ def deploy(commit_hint=""): log.exception("deploy failed") tail.append(f"error: {exc}") return False, "\n".join(tail) + finally: + fcntl.flock(deploy_lock_file, fcntl.LOCK_UN) class Handler(BaseHTTPRequestHandler):