Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

upgrade: Skip the pre-work if the server is already stopped.

Alex Vandiverb15d8e011819
diff --git a/scripts/lib/upgrade-zulip-stage-2 b/scripts/lib/upgrade-zulip-stage-2
index d7a08c94c02..836a22bf090 100755
--- a/scripts/lib/upgrade-zulip-stage-2
+++ b/scripts/lib/upgrade-zulip-stage-2
@@ -322,9 +322,12 @@ else:
# Our next optimization is to check whether any migrations are needed
# 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
-if not args.skip_migrations:
+if not IS_SERVER_UP:
+ migrations_needed = True
+elif not args.skip_migrations:
logging.info("Checking for needed migrations")
migrations_output = subprocess.check_output(
["./manage.py", "showmigrations"], preexec_fn=su_to_zulip, text=True