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