##// END OF EJS Templates
fix(celery): signal startup failure with sys.exit to recycle celery worker on errors
super-admin -
r5403:64d7f92c default
parent child Browse files
Show More
@@ -32,6 +32,7 b' inspect_getargspec()'
32 32 inspect_formatargspec()
33 33 # python3.11 inspect patches for backward compat on `paste` code
34 34
35 import sys
35 36 import logging
36 37 import importlib
37 38
@@ -160,12 +161,12 b" def _init_celery(app_type=''):"
160 161 try:
161 162 env = bootstrap(ini_file, options=options)
162 163 except Exception:
163 log.exception('Failed to bootstrap RhodeCode APP')
164 log.exception('Failed to bootstrap RhodeCode APP. '
165 'Probably there is another error present that prevents from running pyramid app')
164 166
165 167 if not env:
166 raise EnvironmentError(
167 'Failed to load pyramid ENV. '
168 'Probably there is another error present that prevents from running pyramid app')
168 # we use sys.exit here since we need to signal app startup failure for docker to restart the container and re-try
169 sys.exit(1)
169 170
170 171 log.debug('Got Pyramid ENV: %s', env)
171 172
General Comments 0
You need to be logged in to leave comments. Login now