From 7b24f5eb217a597b75ab1c31a7c9c1b383203d4f Mon Sep 17 00:00:00 2001 From: jxxghp Date: Fri, 7 Mar 2025 08:19:28 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=AB=99=E7=82=B9=E6=B5=81?= =?UTF-8?q?=E6=8E=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/chain/search.py | 5 ----- app/modules/indexer/__init__.py | 6 ++++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/app/chain/search.py b/app/chain/search.py index 24d9edf7..8b856f9b 100644 --- a/app/chain/search.py +++ b/app/chain/search.py @@ -312,11 +312,6 @@ class SearchChain(ChainBase): for indexer in self.siteshelper.get_indexers(): # 检查站点索引开关 if not sites or indexer.get("id") in sites: - # 站点流控 - state, msg = self.siteshelper.check(indexer.get("domain")) - if state: - logger.warn(msg) - continue indexer_sites.append(indexer) if not indexer_sites: logger.warn('未开启任何有效站点,无法搜索资源') diff --git a/app/modules/indexer/__init__.py b/app/modules/indexer/__init__.py index 3fbc2b22..548d65d6 100644 --- a/app/modules/indexer/__init__.py +++ b/app/modules/indexer/__init__.py @@ -122,6 +122,12 @@ class IndexerModule(_ModuleBase): logger.warn(f"{site.get('name')} 不支持中文搜索") continue + # 站点流控 + state, msg = SitesHelper().check(StringUtils.get_url_domain(site.get("domain"))) + if state: + logger.warn(msg) + continue + # 去除搜索关键字中的特殊字符 if search_word: search_word = StringUtils.clear(search_word, replace_word=" ", allow_space=True)