diff --git a/rhodecode/api/views/repo_api.py b/rhodecode/api/views/repo_api.py --- a/rhodecode/api/views/repo_api.py +++ b/rhodecode/api/views/repo_api.py @@ -617,7 +617,7 @@ def get_repo_fts_tree(request, apiuser, cache_namespace_uid = 'cache_repo.{}'.format(repo_id) region = rc_cache.get_or_create_region('cache_repo', cache_namespace_uid) - def compute_fts_tree(repo_id, commit_id, root_path, cache_ver): + def compute_fts_tree(cache_ver, repo_id, commit_id, root_path): return ScmModel().get_fts_data(repo_id, commit_id, root_path) try: @@ -638,7 +638,7 @@ def get_repo_fts_tree(request, apiuser, 'with caching: %s[TTL: %ss]' % ( repo_id, commit_id, cache_on, cache_seconds or 0)) - tree_files = compute_fts_tree(repo_id, commit_id, root_path, 'v1') + tree_files = compute_fts_tree(rc_cache.FILE_TREE_CACHE_VER, repo_id, commit_id, root_path) return tree_files except Exception: diff --git a/rhodecode/apps/repository/views/repo_files.py b/rhodecode/apps/repository/views/repo_files.py --- a/rhodecode/apps/repository/views/repo_files.py +++ b/rhodecode/apps/repository/views/repo_files.py @@ -272,7 +272,8 @@ class RepoFilesView(RepoAppView): 'rhodecode:templates/files/files_browser_tree.mako', self._get_template_context(c), self.request) - return compute_file_tree('v1', self.db_repo.repo_id, commit_id, f_path, full_load) + return compute_file_tree( + rc_cache.FILE_TREE_CACHE_VER, self.db_repo.repo_id, commit_id, f_path, full_load) def _get_archive_spec(self, fname): log.debug('Detecting archive spec for: `%s`', fname) diff --git a/rhodecode/lib/rc_cache/__init__.py b/rhodecode/lib/rc_cache/__init__.py --- a/rhodecode/lib/rc_cache/__init__.py +++ b/rhodecode/lib/rc_cache/__init__.py @@ -47,6 +47,9 @@ from .utils import ( FreshRegionCache, ActiveRegionCache) +FILE_TREE_CACHE_VER = 'v2' + + def configure_dogpile_cache(settings): cache_dir = settings.get('cache_dir') if cache_dir: