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).
This commit is contained in:
inference-bot committed 2026-11-03 19:40:36 +00:00
1 parent 387269e245
commit 8b1f6d4a65
1 file changed
+2 -1
+2 -1
View File
@@ -107,7 +107,6 @@ def run(cmd, timeout, cwd=None):
def deploy(commit_hint=""): def deploy(commit_hint=""):
"""Pull main, rebuild, republish. Returns (ok, log_tail).""" """Pull main, rebuild, republish. Returns (ok, log_tail)."""
try: 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: except BlockingIOError:
return False, "another deploy is already running; skipped" return False, "another deploy is already running; skipped"
@@ -133,6 +132,8 @@ def deploy(commit_hint=""):
log.exception("deploy failed") log.exception("deploy failed")
tail.append(f"error: {exc}") tail.append(f"error: {exc}")
return False, "\n".join(tail) return False, "\n".join(tail)
finally:
fcntl.flock(deploy_lock_file, fcntl.LOCK_UN)
class Handler(BaseHTTPRequestHandler): class Handler(BaseHTTPRequestHandler):