fix 插件重载
This commit is contained in:
parent
f3bdfa38ba
commit
af42f00d5d
@ -171,11 +171,13 @@ class CloudflareSpeedTest(_PluginBase):
|
|||||||
new_hosts.append(host)
|
new_hosts.append(host)
|
||||||
|
|
||||||
# 更新自定义Hosts
|
# 更新自定义Hosts
|
||||||
self.update_config({
|
self.update_config(
|
||||||
|
{
|
||||||
"hosts": new_hosts,
|
"hosts": new_hosts,
|
||||||
"err_hosts": err_hosts,
|
"err_hosts": err_hosts,
|
||||||
"enable": enable
|
"enable": enable
|
||||||
}, "CustomHosts")
|
}, "CustomHosts"
|
||||||
|
)
|
||||||
|
|
||||||
# 更新优选ip
|
# 更新优选ip
|
||||||
old_ip = self._cf_ip
|
old_ip = self._cf_ip
|
||||||
|
@ -219,18 +219,6 @@ class CustomHosts(_PluginBase):
|
|||||||
self.systemmessage.put(f"更新系统hosts文件失败:{str(err) or '请检查权限'}")
|
self.systemmessage.put(f"更新系统hosts文件失败:{str(err) or '请检查权限'}")
|
||||||
return err_flag, err_hosts
|
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):
|
def stop_service(self):
|
||||||
"""
|
"""
|
||||||
退出插件
|
退出插件
|
||||||
|
Loading…
x
Reference in New Issue
Block a user