diff --git a/configs/development.ini b/configs/development.ini --- a/configs/development.ini +++ b/configs/development.ini @@ -383,7 +383,7 @@ file_store.storage_path = %(here)s/data/ ; CELERY CONFIG ; ############# -; 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 +; 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 use_celery = false diff --git a/configs/production.ini b/configs/production.ini --- a/configs/production.ini +++ b/configs/production.ini @@ -334,7 +334,7 @@ file_store.storage_path = %(here)s/data/ ; CELERY CONFIG ; ############# -; 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 +; 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 use_celery = false diff --git a/rhodecode/lib/celerylib/loader.py b/rhodecode/lib/celerylib/loader.py --- a/rhodecode/lib/celerylib/loader.py +++ b/rhodecode/lib/celerylib/loader.py @@ -21,10 +21,11 @@ Celery loader, run with:: celery worker \ + --task-events \ --beat \ --app rhodecode.lib.celerylib.loader \ --scheduler rhodecode.lib.celerylib.scheduler.RcScheduler \ - --loglevel DEBUG --ini=._dev/dev.ini + --loglevel DEBUG --ini=.dev/dev.ini """ import os import logging @@ -134,7 +135,10 @@ def on_preload_parsed(options, **kwargs) ini_file_glob = ini_location log.debug('Bootstrapping RhodeCode application...') - env = bootstrap(ini_location, options=options) + try: + env = bootstrap(ini_location, options=options) + except Exception: + log.exception('Failed to bootstrap RhodeCode APP') celery_settings = get_celery_config(env['registry'].settings) setup_celery_app( @@ -262,6 +266,8 @@ class RequestContextTask(Task): """ queue the job to run (we are in web request context here) """ req = get_current_request() + log.debug('Running Task: %s with class: %s. Request: %s Class: %s', + self, self.__class__, req, req.__class__) # web case if hasattr(req, 'user'): diff --git a/rhodecode/lib/paster_commands/deprecated/celeryd.py b/rhodecode/lib/paster_commands/deprecated/celeryd.py --- a/rhodecode/lib/paster_commands/deprecated/celeryd.py +++ b/rhodecode/lib/paster_commands/deprecated/celeryd.py @@ -39,6 +39,6 @@ class Command(BasePasterCommand): pass def command(self): - cmd = 'celery worker --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file + cmd = 'celery worker --task-events --beat --app rhodecode.lib.celerylib.loader --loglevel DEBUG --ini=%s' % self.path_to_ini_file raise Exception('This Command is deprecated please run: %s' % cmd) diff --git a/rhodecode/tests/rhodecode.ini b/rhodecode/tests/rhodecode.ini --- a/rhodecode/tests/rhodecode.ini +++ b/rhodecode/tests/rhodecode.ini @@ -300,7 +300,7 @@ file_store.storage_path = %(here)s/data/ ; CELERY CONFIG ; ############# -; 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 +; 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 use_celery = false