Show More
@@ -1977,7 +1977,7 b' class Repository(Base, BaseModel):' | |||
|
1977 | 1977 | return self._get_instance() |
|
1978 | 1978 | |
|
1979 | 1979 | invalidator_context = CacheKey.repo_context_cache( |
|
1980 | _get_repo, self.repo_name, None) | |
|
1980 | _get_repo, self.repo_name, None, thread_scoped=True) | |
|
1981 | 1981 | |
|
1982 | 1982 | with invalidator_context as context: |
|
1983 | 1983 | context.invalidate() |
@@ -2848,7 +2848,8 b' class CacheKey(Base, BaseModel):' | |||
|
2848 | 2848 | return None |
|
2849 | 2849 | |
|
2850 | 2850 | @classmethod |
|
2851 |
def repo_context_cache(cls, compute_func, repo_name, cache_type |
|
|
2851 | def repo_context_cache(cls, compute_func, repo_name, cache_type, | |
|
2852 | thread_scoped=False): | |
|
2852 | 2853 | """ |
|
2853 | 2854 | @cache_region('long_term') |
|
2854 | 2855 | def _heavy_calculation(cache_key): |
@@ -2864,7 +2865,8 b' class CacheKey(Base, BaseModel):' | |||
|
2864 | 2865 | assert computed == 'result' |
|
2865 | 2866 | """ |
|
2866 | 2867 | from rhodecode.lib import caches |
|
2867 |
return caches.InvalidationContext( |
|
|
2868 | return caches.InvalidationContext( | |
|
2869 | compute_func, repo_name, cache_type, thread_scoped=thread_scoped) | |
|
2868 | 2870 | |
|
2869 | 2871 | |
|
2870 | 2872 | class ChangesetComment(Base, BaseModel): |
General Comments 0
You need to be logged in to leave comments.
Login now