From af42f00d5d7050cb78f4622e97e02b80df1b041d Mon Sep 17 00:00:00 2001 From: thsrite Date: Fri, 4 Aug 2023 12:22:53 +0800 Subject: [PATCH] =?UTF-8?q?fix=20=E6=8F=92=E4=BB=B6=E9=87=8D=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/plugins/cloudflarespeedtest/__init__.py | 12 +++++++----- app/plugins/customhosts/__init__.py | 12 ------------ 2 files changed, 7 insertions(+), 17 deletions(-) diff --git a/app/plugins/cloudflarespeedtest/__init__.py b/app/plugins/cloudflarespeedtest/__init__.py index a3631758..c92a0450 100644 --- a/app/plugins/cloudflarespeedtest/__init__.py +++ b/app/plugins/cloudflarespeedtest/__init__.py @@ -171,11 +171,13 @@ class CloudflareSpeedTest(_PluginBase): new_hosts.append(host) # 更新自定义Hosts - self.update_config({ - "hosts": new_hosts, - "err_hosts": err_hosts, - "enable": enable - }, "CustomHosts") + self.update_config( + { + "hosts": new_hosts, + "err_hosts": err_hosts, + "enable": enable + }, "CustomHosts" + ) # 更新优选ip old_ip = self._cf_ip diff --git a/app/plugins/customhosts/__init__.py b/app/plugins/customhosts/__init__.py index 193f7c28..001eb8be 100644 --- a/app/plugins/customhosts/__init__.py +++ b/app/plugins/customhosts/__init__.py @@ -219,18 +219,6 @@ class CustomHosts(_PluginBase): self.systemmessage.put(f"更新系统hosts文件失败:{str(err) or '请检查权限'}") return err_flag, err_hosts - @eventmanager.register(EventType.PluginReload) - def reload(self, event): - """ - 响应插件重载事件 - """ - plugin_id = event.event_data.get("plugin_id") - if not plugin_id: - return - if plugin_id != self.__class__.__name__: - return - return self.init_plugin(self.get_config()) - def stop_service(self): """ 退出插件