celerylib: fixed broken tasks for auto-update

This commit is contained in:
RhodeCode Admin 2021-10-12 14:09:11 +02:00
parent 448f66785c
commit f5cf1a1f86
2 changed files with 9 additions and 3 deletions

View file

@ -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:

View file

@ -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)