def flush_role(cls, role): # Clear collections ACL cache. cache.kv.hdel(cls.ACCESS, role.id) if role.is_blocked or role.deleted_at is not None: # End all user sessions. prefix = cache.key(cls.TOKENS, "%s." % role.id) cache.flush(prefix=prefix)
def resetcache(): """Clear the redis cache.""" cache.flush()