restart-server: Skip weekly restart-server if a deploy is in process.

This is unlikely, but cron running `restart-server` at the random
wrong time mid-deploy could be bad.
This commit is contained in:
Alex Vandiver
2025-07-14 17:37:07 +00:00
committed by Tim Abbott
parent a5a5791794
commit 6d80d4c77f

View File

@@ -17,6 +17,7 @@ from scripts.lib.supervisor import list_supervisor_processes
from scripts.lib.zulip_tools import (
DEPLOYMENTS_DIR,
ENDC,
LOCK_DIR,
OKGREEN,
WARNING,
get_config,
@@ -51,6 +52,10 @@ elif username != "zulip":
sys.exit(1)
if os.environ.get("RUNNING_UNDER_CRON") and os.path.exists(LOCK_DIR):
logging.info("Skipping cron-triggered restart during deploy.")
sys.exit(1)
if not args.skip_checks:
logging.info("Running syntax and database checks")
subprocess.check_call(["./manage.py", "check", "--database", "default"])