upgrade: Call ./scripts/stop-server rather than duplicate the logic.

This commit is contained in:
Alex Vandiver 2021-04-20 02:21:47 +00:00 committed by Tim Abbott
parent ec12a6128a
commit 16650ba239
1 changed files with 1 additions and 17 deletions

View File

@ -101,19 +101,8 @@ IS_SERVER_UP = True
def shutdown_server() -> None:
global IS_SERVER_UP
core_server_services = [
"zulip-django",
"zulip-tornado" if tornado_processes == 1 else "zulip-tornado:*",
]
worker_services = ["zulip-workers:*"]
# Stop and start thumbor service only if thumbor is installed.
if os.path.exists("/etc/supervisor/conf.d/zulip/thumbor.conf"):
core_server_services.append("zulip-thumbor")
logging.info("Stopping Zulip...")
subprocess.check_call(
["supervisorctl", "stop", *worker_services, *core_server_services], preexec_fn=su_to_zulip
)
subprocess.check_call(["./scripts/stop-server"], preexec_fn=su_to_zulip)
IS_SERVER_UP = False
@ -273,11 +262,6 @@ if not args.skip_migrations:
logging.info("Creating some expensive indexes before starting downtime.")
subprocess.check_call(["./manage.py", "create_large_indexes"], preexec_fn=su_to_zulip)
# Now we start shutting down services; we start with
# process-fts-updates, which isn't on the critical serving path.
if os.path.exists("/etc/supervisor/conf.d/zulip/zulip_db.conf"):
subprocess.check_call(["supervisorctl", "stop", "process-fts-updates"], preexec_fn=su_to_zulip)
if (not args.skip_puppet or migrations_needed) and IS_SERVER_UP:
# By default, we shut down the service to apply migrations and
# Puppet changes, to minimize risk of issues due to inconsistent