From 1424087d5a7db9d6517ff52e25fad94d29c048c1 Mon Sep 17 00:00:00 2001 From: jxxghp Date: Wed, 4 Jun 2025 18:34:49 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9Amemory=20use?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/modules/indexer/__init__.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/modules/indexer/__init__.py b/app/modules/indexer/__init__.py index 98a79f95..4b065caa 100644 --- a/app/modules/indexer/__init__.py +++ b/app/modules/indexer/__init__.py @@ -238,7 +238,11 @@ class IndexerModule(_ModuleBase): cat=cat, page=page) - return _spider.is_error, _spider.get_torrents() + try: + return _spider.is_error, _spider.get_torrents() + finally: + # 显式清理SiteSpider对象 + del _spider def refresh_torrents(self, site: dict, keyword: Optional[str] = None, cat: Optional[str] = None, page: Optional[int] = 0) -> Optional[List[TorrentInfo]]: