##// END OF EJS Templates
celery: improve errors handling and logging
super-admin -
r4868:862a2784 default
parent child Browse files
Show More
@@ -383,7 +383,7 b' file_store.storage_path = %(here)s/data/'
383 ; CELERY CONFIG
383 ; CELERY CONFIG
384 ; #############
384 ; #############
385
385
386 ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini
386 ; manually run celery: /path/to/celery worker --task-events --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini
387
387
388 use_celery = false
388 use_celery = false
389
389
@@ -334,7 +334,7 b' file_store.storage_path = %(here)s/data/'
334 ; CELERY CONFIG
334 ; CELERY CONFIG
335 ; #############
335 ; #############
336
336
337 ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini
337 ; manually run celery: /path/to/celery worker --task-events --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini
338
338
339 use_celery = false
339 use_celery = false
340
340
@@ -21,10 +21,11 b''
21 Celery loader, run with::
21 Celery loader, run with::
22
22
23 celery worker \
23 celery worker \
24 --task-events \
24 --beat \
25 --beat \
25 --app rhodecode.lib.celerylib.loader \
26 --app rhodecode.lib.celerylib.loader \
26 --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
27 --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \
27 --loglevel DEBUG --ini=._dev/dev.ini
28 --loglevel DEBUG --ini=.dev/dev.ini
28 """
29 """
29 import os
30 import os
30 import logging
31 import logging
@@ -134,7 +135,10 b' def on_preload_parsed(options, **kwargs)'
134 ini_file_glob = ini_location
135 ini_file_glob = ini_location
135
136
136 log.debug('Bootstrapping RhodeCode application...')
137 log.debug('Bootstrapping RhodeCode application...')
137 env = bootstrap(ini_location, options=options)
138 try:
139 env = bootstrap(ini_location, options=options)
140 except Exception:
141 log.exception('Failed to bootstrap RhodeCode APP')
138
142
139 celery_settings = get_celery_config(env['registry'].settings)
143 celery_settings = get_celery_config(env['registry'].settings)
140 setup_celery_app(
144 setup_celery_app(
@@ -262,6 +266,8 b' class RequestContextTask(Task):'
262 """ queue the job to run (we are in web request context here) """
266 """ queue the job to run (we are in web request context here) """
263
267
264 req = get_current_request()
268 req = get_current_request()
269 log.debug('Running Task: %s with class: %s. Request: %s Class: %s',
270 self, self.__class__, req, req.__class__)
265
271
266 # web case
272 # web case
267 if hasattr(req, 'user'):
273 if hasattr(req, 'user'):
@@ -39,6 +39,6 b' class Command(BasePasterCommand):'
39 pass
39 pass
40
40
41 def command(self):
41 def command(self):
42 cmd = 'celery worker --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file
42 cmd = 'celery worker --task-events --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file
43 raise Exception('This Command is deprecated please run: %s' % cmd)
43 raise Exception('This Command is deprecated please run: %s' % cmd)
44
44
@@ -300,7 +300,7 b' file_store.storage_path = %(here)s/data/'
300 ; CELERY CONFIG
300 ; CELERY CONFIG
301 ; #############
301 ; #############
302
302
303 ; manually run celery: /path/to/celery worker -E --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini
303 ; manually run celery: /path/to/celery worker --task-events --beat --app rhodecode.lib.celerylib.loader --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler --loglevel DEBUG --ini /path/to/rhodecode.ini
304
304
305 use_celery = false
305 use_celery = false
306
306
General Comments 0
You need to be logged in to leave comments. Login now