fix cache maxsize

This commit is contained in:
jxxghp
2025-08-21 20:10:27 +08:00
parent d457a23a1f
commit da1c8a162d
+1 -1
View File
@@ -261,7 +261,7 @@ class MemoryBackend(CacheBackend):
:param maxsize: 缓存的最大条目数 :param maxsize: 缓存的最大条目数
:param ttl: 默认缓存存活时间,单位秒 :param ttl: 默认缓存存活时间,单位秒
""" """
self.maxsize = maxsize self.maxsize = maxsize or 1024 # 未设置时默认最大条目数为 1024
self.ttl = ttl self.ttl = ttl
# 存储各个 region 的缓存实例,region -> TTLCache # 存储各个 region 的缓存实例,region -> TTLCache
self._region_caches: Dict[str, MemoryTTLCache] = {} self._region_caches: Dict[str, MemoryTTLCache] = {}