celerylib: fixed broken tasks for auto-update
This commit is contained in:
parent
448f66785c
commit
f5cf1a1f86
2 changed files with 9 additions and 3 deletions
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue