From da1c8a162d9b54689a19bff31cc3f8cc03163fae Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 21 Aug 2025 20:10:27 +0800 Subject: [PATCH] fix cache maxsize --- app/core/cache.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/core/cache.py b/app/core/cache.py index 9e945b3e..b7284187 100644 --- a/app/core/cache.py +++ b/app/core/cache.py @@ -261,7 +261,7 @@ class MemoryBackend(CacheBackend): :param maxsize: 缓存的最大条目数 :param ttl: 默认缓存存活时间,单位秒 """ - self.maxsize = maxsize + self.maxsize = maxsize or 1024 # 未设置时默认最大条目数为 1024 self.ttl = ttl # 存储各个 region 的缓存实例,region -> TTLCache self._region_caches: Dict[str, MemoryTTLCache] = {}