automation: updated update task to update repositories and groups....
dan -
r4160:7447e8d1 default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -35,7 +35,8
35 from rhodecode.lib.celerylib import get_logger, async_task, RequestContextTask
35 from rhodecode.lib.celerylib import get_logger, async_task, RequestContextTask
36 from rhodecode.lib.hooks_base import log_create_repository
36 from rhodecode.lib.hooks_base import log_create_repository
37 from rhodecode.lib.utils2 import safe_int, str2bool
37 from rhodecode.lib.utils2 import safe_int, str2bool
38 from rhodecode.model.db import Session, IntegrityError, Repository, User, true
38 from rhodecode.model.db import (
39 Session, IntegrityError, true, Repository, RepoGroup, User)
39
40
40
41
41 @async_task(ignore_result=True, base=RequestContextTask)
42 @async_task(ignore_result=True, base=RequestContextTask)
@@ -344,6 +345,21
344
345
345
346
346 @async_task(ignore_result=True)
347 @async_task(ignore_result=True)
347 def sync_repo_groups_last_update(*args, **kwargs):
348 def sync_last_update(*args, **kwargs):
348 from rhodecode.model.repo_group import RepoGroupModel
349
349 return RepoGroupModel().update_commit_cache()
350 skip_repos = kwargs.get('skip_repos')
351 if not skip_repos:
352 repos = Repository.query() \
353 .order_by(Repository.group_id.asc())
354
355 for repo in repos:
356 repo.update_commit_cache()
357
358 skip_groups = kwargs.get('skip_groups')
359 if not skip_groups:
360 repo_groups = RepoGroup.query() \
361 .filter(RepoGroup.group_parent_id == None)
362
363 for root_gr in repo_groups:
364 for repo_gr in reversed(root_gr.recursive_groups()):
365 repo_gr.update_commit_cache()
Comments 0
You need to be logged in to leave comments. Login now