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:
1 parent
387269e245
commit
8b1f6d4a65
1 file changed
+3
-2
@@ -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):
|
||||
|
||||
Reference in new issue
Block a user