Monibuca / engine

Monibuca 核心引擎,包含流媒体核心转发逻辑,需要配合功能插件一起组合运行
MIT License
937 stars 199 forks source link

热更新配置接口 #80

Closed Detxie closed 1 year ago

Detxie commented 1 year ago

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

langhuihui commented 1 year ago

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

Detxie commented 1 year ago

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

engine/http.go -> API_updateConfig接口

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

langhuihui commented 1 year ago

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

Detxie commented 1 year ago

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

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

langhuihui commented 1 year ago

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

DonieGeng commented 1 year ago

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

langhuihui commented 1 year ago

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