perf: 使用scan命令扫描在线用户

pull/11951/head
jiangweidong 2023-10-20 14:09:13 +08:00 committed by Bryan
parent cea24f0ccf
commit f51d375f48
1 changed files with 1 additions and 1 deletions

View File

@ -287,7 +287,7 @@ class UserSession(models.Model):
def get_keys():
session_store_cls = import_module(settings.SESSION_ENGINE).SessionStore
cache_key_prefix = session_store_cls.cache_key_prefix
keys = caches[settings.SESSION_CACHE_ALIAS].keys('*')
keys = caches[settings.SESSION_CACHE_ALIAS].iter_keys('*')
return [k.replace(cache_key_prefix, '') for k in keys]
@classmethod