# HG changeset patch # User RhodeCode Admin # Date 2024-02-15 13:24:48 # Node ID eaec72ab54a5a1942fdaca43e9f5b7b7f0b6e2bd # Parent 2823fa9f3dd0ba4a9b0f68ba0d4f9603666f2b72 fix(cache-invalidation): fixed case when empty repos once cached wouldn't invalidate caches because of empty case condition diff --git a/rhodecode/model/db.py b/rhodecode/model/db.py --- a/rhodecode/model/db.py +++ b/rhodecode/model/db.py @@ -2634,12 +2634,11 @@ class Repository(Base, BaseModel): previous_state_uid, instance = cache_func(*args) - if instance: - # now compare keys, the "cache" state vs expected state. - if previous_state_uid != cache_state_uid: - log.warning('Cached state uid %s is different than current state uid %s', - previous_state_uid, cache_state_uid) - _, instance = cache_func.refresh(*args) + # now compare keys, the "cache" state vs expected state. + if previous_state_uid != cache_state_uid: + log.warning('Cached state uid %s is different than current state uid %s', + previous_state_uid, cache_state_uid) + _, instance = cache_func.refresh(*args) log.debug('Repo instance fetched in %.4fs', inv_context_manager.compute_time) return instance @@ -2652,6 +2651,7 @@ class Repository(Base, BaseModel): 'cache': cache, # controls the vcs.remote cache 'repo_state_uid': repo_state_uid } + repo = get_vcs_instance( repo_path=safe_str(self.repo_full_path), config=config,