From bc242f4fd4448c3ca1046da5a5ecc1a187bda2c3 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Thu, 21 Aug 2025 12:04:15 +0800 Subject: [PATCH] fix yield --- app/core/cache.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/app/core/cache.py b/app/core/cache.py index 6a36cbdd..8bd29d71 100644 --- a/app/core/cache.py +++ b/app/core/cache.py @@ -362,6 +362,7 @@ class CacheToolsBackend(CacheBackend): region_cache = self.__get_region_cache(region) if region_cache is None: yield from () + return for item in region_cache.items(): yield item @@ -635,6 +636,7 @@ class FileBackend(CacheBackend): cache_path = self.base / region if not cache_path.exists(): yield from () + return for item in cache_path.iterdir(): if item.is_file(): with open(item, 'r') as f: @@ -747,6 +749,7 @@ class AsyncFileBackend(AsyncCacheBackend): cache_path = AsyncPath(self.base) / region if not await cache_path.exists(): yield "", None + return async for item in cache_path.iterdir(): if await item.is_file(): async with aiofiles.open(item, 'r') as f: