management: Provide a common lockfile dir, and a decorator for it.

Factor out the repeated pattern of taking a lock, or immediately
aborting with a message if it cannot be acquired.  The exit code in
that situation is changed to be exit code 1, rather than the successful
0; we are likely missing new work since that process started.

We move the lockfiles to a common directory under `/srv/zulip-locks`
rather than muddy up `/home/zulip/deployments`.
This commit is contained in:
Alex Vandiver
2024-04-23 18:58:26 +00:00
committed by Tim Abbott
parent 572fafd6b9
commit 11dd6791c4
5 changed files with 40 additions and 31 deletions

View File

@@ -208,6 +208,7 @@ class zulip::app_frontend_base {
'/home/zulip/tornado',
'/home/zulip/prod-static',
'/home/zulip/deployments',
'/srv/zulip-locks',
'/srv/zulip-emoji-cache',
'/srv/zulip-uploaded-files-cache',
]: