Skip boot code while migrating (speed-up, permission issue fix)

pull/518/head
Piero Toffanin 2018-09-12 10:42:09 -04:00
rodzic 14b6a355e2
commit 83fd1e9336
2 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -25,7 +25,7 @@ from webodm.wsgi import booted
def boot():
# booted is a shared memory variable to keep track of boot status
# as multiple gunicorn workers could trigger the boot sequence twice
if not settings.DEBUG and booted.value: return
if (not settings.DEBUG and booted.value) or settings.MIGRATING: return
booted.value = True
logger = logging.getLogger('app.logger')

Wyświetl plik

@ -45,6 +45,7 @@ with open(os.path.join(BASE_DIR, 'package.json')) as package_file:
VERSION = data['version']
TESTING = sys.argv[1:2] == ['test']
MIGRATING = sys.argv[1:2] == ['migrate']
WORKER_RUNNING = sys.argv[2:3] == ["worker"]
# SECURITY WARNING: don't run with debug turned on a public facing server!