优化配置中心 添加异常处理机制 以免上层业务导致底层协程崩溃
This commit is contained in:
parent
24885902af
commit
88423a2301
@ -2,6 +2,7 @@ package configure
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"go_dreamfactory/lego"
|
||||||
"go_dreamfactory/lego/sys/log"
|
"go_dreamfactory/lego/sys/log"
|
||||||
"io/fs"
|
"io/fs"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
@ -192,7 +193,11 @@ func (this *Configure) checkConfigure() {
|
|||||||
}
|
}
|
||||||
for _, v := range handle.events {
|
for _, v := range handle.events {
|
||||||
if v != nil {
|
if v != nil {
|
||||||
go v()
|
go func(f func()) {
|
||||||
|
defer lego.Recover("configure")
|
||||||
|
f()
|
||||||
|
}(v)
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user