recover.go 260 字节
Newer Older
W
wangzelin.wzl 已提交
1 2
package engine

O
ob-robot 已提交
3 4 5
import (
	"github.com/sirupsen/logrus"
)
W
wangzelin.wzl 已提交
6 7 8 9 10 11 12

// GoroutineProtection goroutine recovery mechanism for panic
func GoroutineProtection(entry *logrus.Entry) {
	if err := recover(); err != nil {
		entry.Error("goroutine protection error : ", err)
	}
}