cache-commits: add option to refresh caches manually from advanced pages.
dan -
r4159:0bc78b10 default
Not Reviewed
Show More
Add another comment
TODOs: 0 unresolved 0 Resolved
COMMENTS: 0 General 0 Inline
@@ -46,9 +46,16
46 route_name='edit_repo_group_advanced', request_method='GET',
46 route_name='edit_repo_group_advanced', request_method='GET',
47 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
47 renderer='rhodecode:templates/admin/repo_groups/repo_group_edit.mako')
48 def edit_repo_group_advanced(self):
48 def edit_repo_group_advanced(self):
49 _ = self.request.translate
49 c = self.load_default_context()
50 c = self.load_default_context()
50 c.active = 'advanced'
51 c.active = 'advanced'
51 c.repo_group = self.db_repo_group
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 return self._get_template_context(c)
59 return self._get_template_context(c)
53
60
54 @LoginRequired()
61 @LoginRequired()
@@ -60,6 +60,7
60 route_name='edit_repo_advanced', request_method='GET',
60 route_name='edit_repo_advanced', request_method='GET',
61 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
61 renderer='rhodecode:templates/admin/repos/repo_edit.mako')
62 def edit_advanced(self):
62 def edit_advanced(self):
63 _ = self.request.translate
63 c = self.load_default_context()
64 c = self.load_default_context()
64 c.active = 'advanced'
65 c.active = 'advanced'
65
66
@@ -70,6 +71,11
70
71
71 c.ver_info_dict = self.rhodecode_vcs_repo.get_hooks_info()
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 return self._get_template_context(c)
79 return self._get_template_context(c)
74
80
75 @LoginRequired()
81 @LoginRequired()
@@ -8,8 +8,11
8 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email, tooltip=True), '', ''),
8 (_('Owner'), lambda:base.gravatar_with_user(c.repo_group.user.email, tooltip=True), '', ''),
9 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
9 (_('Created on'), h.format_date(c.repo_group.created_on), '', ''),
10 (_('Updated on'), h.format_date(c.repo_group.updated_on), '', ''),
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 (_('Cached Commit date'), (c.repo_group.changeset_cache.get('date')), '', ''),
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 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
17 (_('Is Personal Group'), c.repo_group.personal or False, '', ''),
15
18
@@ -8,6 +8,7
8 (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
8 (_('Updated on'), h.format_date(c.rhodecode_db_repo.updated_on), '', ''),
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'))), '', ''),
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 (_('Cached Commit date'), c.rhodecode_db_repo.changeset_cache.get('date'), '', ''),
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 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
12 (_('Attached scoped tokens'), len(c.rhodecode_db_repo.scoped_tokens), '', [x.user for x in c.rhodecode_db_repo.scoped_tokens]),
12 (_('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 (_('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 (_('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]),
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]),
Comments 0
You need to be logged in to leave comments. Login now