##// END OF EJS Templates
caches: invalidate cache on remote side from repo settings alongside local cache.
super-admin -
r4748:28ed66c7 default
parent child Browse files
Show More
@@ -66,18 +66,28 b' class RepoCachesView(RepoAppView):'
66 _ = self.request.translate
66 _ = self.request.translate
67 c = self.load_default_context()
67 c = self.load_default_context()
68 c.active = 'caches'
68 c.active = 'caches'
69 invalidated = 0
69
70
70 try:
71 try:
71 ScmModel().mark_for_invalidation(self.db_repo_name, delete=True)
72 ScmModel().mark_for_invalidation(self.db_repo_name, delete=True)
72
73 Session().commit()
73 Session().commit()
74
74 invalidated +=1
75 h.flash(_('Cache invalidation successful'),
76 category='success')
77 except Exception:
75 except Exception:
78 log.exception("Exception during cache invalidation")
76 log.exception("Exception during cache invalidation")
79 h.flash(_('An error occurred during cache invalidation'),
77 h.flash(_('An error occurred during cache invalidation'),
80 category='error')
78 category='error')
81
79
80 try:
81 invalidated += 1
82 self.rhodecode_vcs_repo.vcsserver_invalidate_cache(delete=True)
83 except Exception:
84 log.exception("Exception during vcsserver cache invalidation")
85 h.flash(_('An error occurred during vcsserver cache invalidation'),
86 category='error')
87
88 if invalidated:
89 h.flash(_('Cache invalidation successful. Stages {}/2').format(invalidated),
90 category='success')
91
82 raise HTTPFound(h.route_path(
92 raise HTTPFound(h.route_path(
83 'edit_repo_caches', repo_name=self.db_repo_name)) No newline at end of file
93 'edit_repo_caches', repo_name=self.db_repo_name))
@@ -875,6 +875,9 b' class BaseRepository(object):'
875 def get_hooks_info(self):
875 def get_hooks_info(self):
876 return self._remote.get_hooks_info()
876 return self._remote.get_hooks_info()
877
877
878 def vcsserver_invalidate_cache(self, delete=False):
879 return self._remote.vcsserver_invalidate_cache(delete)
880
878
881
879 class BaseCommit(object):
882 class BaseCommit(object):
880 """
883 """
General Comments 0
You need to be logged in to leave comments. Login now