diff --git a/rhodecode/lib/celerylib/__init__.py b/rhodecode/lib/celerylib/__init__.py --- a/rhodecode/lib/celerylib/__init__.py +++ b/rhodecode/lib/celerylib/__init__.py @@ -43,6 +43,9 @@ class ResultWrapper(object): def run_task(task, *args, **kwargs): log.debug('Got task `%s` for execution', task) + if task is None: + raise ValueError('Got non-existing task for execution') + if rhodecode.CELERY_ENABLED: celery_is_up = False try: diff --git a/rhodecode/lib/celerylib/tasks.py b/rhodecode/lib/celerylib/tasks.py --- a/rhodecode/lib/celerylib/tasks.py +++ b/rhodecode/lib/celerylib/tasks.py @@ -386,9 +386,7 @@ def beat_check(*args, **kwargs): return time.time() -@async_task(ignore_result=True) -def sync_last_update(*args, **kwargs): - +def sync_last_update_for_objects(*args, **kwargs): skip_repos = kwargs.get('skip_repos') if not skip_repos: repos = Repository.query() \ @@ -405,3 +403,8 @@ def sync_last_update(*args, **kwargs): for root_gr in repo_groups: for repo_gr in reversed(root_gr.recursive_groups()): repo_gr.update_commit_cache() + + +@async_task(ignore_result=True) +def sync_last_update(*args, **kwargs): + sync_last_update_for_objects(*args, **kwargs)