engine icon indicating copy to clipboard operation
engine copied to clipboard

热更新配置接口

Open YoooDT opened this issue 3 years ago • 7 comments

1.调用热更新配置接口或者先modify再热更新,会报错 2.具体错误 Unmarshal error:reflect : NumField of non-struct type config.Plugin

YoooDT avatar Apr 07 '23 07:04 YoooDT

具体更新的是哪个插件?,详细点日志呢

langhuihui avatar Apr 07 '23 07:04 langhuihui

具体更新的是哪个插件?,详细点日志呢

engine/http.go -> API_updateConfig接口

http请求: ip:port/api/updateconfig?name=Hook

YoooDT avatar Apr 07 '23 07:04 YoooDT

找到原因了,下个版本修复

langhuihui avatar Apr 07 '23 08:04 langhuihui

找到原因了,下个版本修复

具体什么原因呢,我看看如果简单我先本地改了使用

YoooDT avatar Apr 07 '23 08:04 YoooDT

func (opt *Plugin) Update(conf config.Config) { conf.Unmarshal(opt.Config) opt.Config.OnEvent(conf) }

langhuihui avatar Apr 08 '23 08:04 langhuihui

修改后还有问题 image image 错误信息如下 image

DonieGeng avatar Apr 10 '23 01:04 DonieGeng

modify时带上参数yaml=1 body里面传入yaml格式的参数。原因——json反序列化和yaml不同,无法将map自动转换成Config类型

langhuihui avatar Apr 21 '23 01:04 langhuihui