Merge pull request #3026 from jumpserver/dev_bai

[Update] 授权资产变动过期所有缓存(cache_key和cache_meta_key)
pull/3033/head
BaiJiangJie 5 years ago committed by GitHub
commit 4f7daa96a7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -414,15 +414,12 @@ class AssetPermissionCacheMixin:
cache.delete_pattern(key) cache.delete_pattern(key)
self.expire_cache_meta() self.expire_cache_meta()
@classmethod
def expire_all_cache_meta(cls):
key = cls.CACHE_META_KEY_PREFIX + '*'
cache.delete_pattern(key)
@classmethod @classmethod
def expire_all_cache(cls): def expire_all_cache(cls):
key = cls.CACHE_KEY_PREFIX + '*' key = cls.CACHE_KEY_PREFIX + '*'
cache.delete_pattern(key) cache.delete_pattern(key)
meta_key = cls.CACHE_META_KEY_PREFIX + '*'
cache.delete_pattern(meta_key)
class AssetPermissionUtil(AssetPermissionCacheMixin): class AssetPermissionUtil(AssetPermissionCacheMixin):

Loading…
Cancel
Save