mirror of
https://github.com/Monibuca/engine.git
synced 2025-10-06 00:56:58 +08:00
1.修复读取ts中aac格式数据多次flush问题
2.修复subscribe结束时判断IsClosed调用对象错误 3.增加DefaultYaml功能
This commit is contained in:
15
main.go
15
main.go
@@ -9,6 +9,7 @@ import (
|
||||
"net/http"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"reflect"
|
||||
"runtime"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -96,12 +97,20 @@ func Run(ctx context.Context, configFile string) (err error) {
|
||||
EventBus = make(chan any, EngineConfig.EventBusSize)
|
||||
go EngineConfig.Listen(Engine)
|
||||
for name, plugin := range Plugins {
|
||||
plugin.RawConfig = cg.GetChild(name)
|
||||
if plugin.RawConfig != nil {
|
||||
if b, err := yaml.Marshal(plugin.RawConfig); err == nil {
|
||||
userConfig := cg.GetChild(name)
|
||||
if userConfig != nil {
|
||||
if b, err := yaml.Marshal(userConfig); err == nil {
|
||||
plugin.Yaml = string(b)
|
||||
}
|
||||
}
|
||||
if defaultYaml := reflect.ValueOf(plugin.Config).Elem().FieldByName("DefaultYaml"); defaultYaml.IsValid() {
|
||||
if err := yaml.Unmarshal([]byte(defaultYaml.String()), &plugin.RawConfig); err != nil {
|
||||
log.Error("parsing default config error:", err)
|
||||
}
|
||||
}
|
||||
if plugin.Yaml != "" {
|
||||
yaml.Unmarshal([]byte(plugin.Yaml), &plugin.RawConfig)
|
||||
}
|
||||
plugin.assign()
|
||||
}
|
||||
UUID := uuid.NewString()
|
||||
|
Reference in New Issue
Block a user