##// END OF EJS Templates
vcs-cache: enable more methods, and fix arguments calls
super-admin -
r4747:4ec212aa default
parent child Browse files
Show More
@@ -245,10 +245,21 b' class RemoteRepo(object):'
245 245
246 246 cache_on = False
247 247 cache_key = ''
248 local_cache = rhodecode.CONFIG.get('vcs.methods.cache')
249 if local_cache and name in ['is_large_file', 'is_binary', 'fctx_size', 'bulk_request']:
248 local_cache_on = rhodecode.CONFIG.get('vcs.methods.cache')
249
250 cache_methods = [
251 'branches', 'tags', 'bookmarks',
252 'is_large_file', 'is_binary', 'fctx_size', 'node_history', 'blob_raw_length',
253 'revision', 'tree_items',
254 'ctx_list',
255 'bulk_request',
256 ]
257
258 if local_cache_on and name in cache_methods:
250 259 cache_on = True
251 cache_key = compute_key_from_params(name, args[0], args[1])
260 repo_state_uid = self._wire['repo_state_uid']
261 call_args = [a for a in args]
262 cache_key = compute_key_from_params(repo_state_uid, name, *call_args)
252 263
253 264 @self._cache_region.conditional_cache_on_arguments(
254 265 namespace=self._cache_namespace, condition=cache_on and cache_key)
General Comments 0
You need to be logged in to leave comments. Login now