Browse Source

Merge pull request #3026 from jumpserver/dev_bai

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

7
apps/perms/utils/asset_permission.py

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

Loading…
Cancel
Save