##// END OF EJS Templates
cache-commits: add option to refresh caches manually from advanced pages.
dan -
r4159:0bc78b10 default
parent child Browse files
Show More
@@ -46,9 +46,16 b' class RepoGroupSettingsView(RepoGroupApp'
46 46 route_name='edit_repo_group_advanced', request_method='GET',
47 47 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
48 48 def edit_repo_group_advanced(self):
49 _ = self.request.translate
49 50 c = self.load_default_context()
50 51 c.active = 'advanced'
51 52 c.repo_group = self.db_repo_group
53
54 # update commit cache if GET flag is present
55 if self.request.GET.get('update_commit_cache'):
56 self.db_repo_group.update_commit_cache()
57 h.flash(_('updated commit cache'), category='success')
58
52 59 return self._get_template_context(c)
53 60
54 61 @LoginRequired()
@@ -60,6 +60,7 b' class RepoSettingsView(RepoAppView):'
60 60 route_name='edit_repo_advanced', request_method='GET',
61 61 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
62 62 def edit_advanced(self):
63 _ = self.request.translate
63 64 c = self.load_default_context()
64 65 c.active = 'advanced'
65 66
@@ -70,6 +71,11 b' class RepoSettingsView(RepoAppView):'
70 71
71 72 c.ver_info_dict = self.rhodecode_vcs_repo.get_hooks_info()
72 73
74 # update commit cache if GET flag is present
75 if self.request.GET.get('update_commit_cache'):
76 self.db_repo.update_commit_cache()
77 h.flash(_('updated commit cache'), category='success')
78
73 79 return self._get_template_context(c)
74 80
75 81 @LoginRequired()
@@ -8,8 +8,11 b''
8 8 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email, tooltip=True), '', ''),
9 9 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
10 10 (_('Updated on'), h.format_date(c.repo_group.updated_on), '', ''),
11 (_('Cached Commit source'), (h.link_to_if(source_repo_id, 'repo_id:{}'.format(source_repo_id), h.route_path('repo_summary', repo_name='_{}'.format(source_repo_id)))), '', ''),
12 (_('Cached Commit id'), c.repo_group.changeset_cache.get('short_id'), '', ''),
11 13 (_('Cached Commit date'), (c.repo_group.changeset_cache.get('date')), '', ''),
12 (_('Cached Commit repo_id'), (h.link_to_if(source_repo_id, source_repo_id, h.route_path('repo_summary', repo_name='_{}'.format(source_repo_id)))), '', ''),
14
15 (_('Cached Commit data'), lambda: h.link_to('refresh now', h.current_route_path(request, update_commit_cache=1)), '', ''),
13 16
14 17 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
15 18
@@ -8,6 +8,7 b''
8 8 (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
9 9 (_('Cached Commit id'), lambda: h.link_to(c.rhodecode_db_repo.changeset_cache.get('short_id'), h.route_path('repo_commit',repo_name=c.repo_name,commit_id=c.rhodecode_db_repo.changeset_cache.get('raw_id'))), '', ''),
10 10 (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''),
11 (_('Cached Commit data'), lambda: h.link_to('refresh now', h.current_route_path(request, update_commit_cache=1)), '', ''),
11 12 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
12 13 (_('Pull requests source'), len(c.rhodecode_db_repo.pull_requests_source), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.source_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_source]),
13 14 (_('Pull requests target'), len(c.rhodecode_db_repo.pull_requests_target), '', ['pr_id:{}, repo:{}'.format(x.pull_request_id,x.target_repo.repo_name) for x in c.rhodecode_db_repo.pull_requests_target]),
General Comments 0
You need to be logged in to leave comments. Login now