mirror of https://github.com/zulip/zulip.git
upgrade: Skip the pre-work if the server is already stopped.
This optimization makes sense if the server is already running, but if it is already stopped, it is just prolonging the downtime.
This commit is contained in:
parent
05af4b0a11
commit
b15d8e0118
|
@ -322,9 +322,12 @@ else:
|
||||||
|
|
||||||
# Our next optimization is to check whether any migrations are needed
|
# Our next optimization is to check whether any migrations are needed
|
||||||
# before we start the critical section of the restart. This saves
|
# before we start the critical section of the restart. This saves
|
||||||
# about 1s of downtime in a no-op upgrade.
|
# about 1s of downtime in a no-op upgrade. We omit this check if we
|
||||||
|
# already stopped the server above, due to low memory.
|
||||||
migrations_needed = False
|
migrations_needed = False
|
||||||
if not args.skip_migrations:
|
if not IS_SERVER_UP:
|
||||||
|
migrations_needed = True
|
||||||
|
elif not args.skip_migrations:
|
||||||
logging.info("Checking for needed migrations")
|
logging.info("Checking for needed migrations")
|
||||||
migrations_output = subprocess.check_output(
|
migrations_output = subprocess.check_output(
|
||||||
["./manage.py", "showmigrations"], preexec_fn=su_to_zulip, text=True
|
["./manage.py", "showmigrations"], preexec_fn=su_to_zulip, text=True
|
||||||
|
|
Loading…
Reference in New Issue