Add the dashboard monitor.

This commit is contained in:
zicla
2018-12-02 18:38:39 +08:00
parent 2d1a95594f
commit 927427f353
18 changed files with 169 additions and 34 deletions

16
rest/util_framework.go Normal file
View File

@ -0,0 +1,16 @@
package rest
//带有panic恢复的方法
func PanicHandler() {
if err := recover(); err != nil {
LOGGER.Error("异步任务错误: %v", err)
}
}
//带有panic恢复的方法
func SafeMethod(f func()) {
defer PanicHandler()
//执行函数
f()
}