优化配置中心 添加异常处理机制 以免上层业务导致底层协程崩溃

This commit is contained in:
liwei1dao 2022-08-25 11:25:00 +08:00
parent 24885902af
commit 88423a2301

View File

@ -2,6 +2,7 @@ package configure
import (
"fmt"
"go_dreamfactory/lego"
"go_dreamfactory/lego/sys/log"
"io/fs"
"io/ioutil"
@ -192,7 +193,11 @@ func (this *Configure) checkConfigure() {
}
for _, v := range handle.events {
if v != nil {
go v()
go func(f func()) {
defer lego.Recover("configure")
f()
}(v)
}
}
}