v1.5.1 增强程序稳定性
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
package stats
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
teaconst "github.com/TeaOSLab/EdgeDNS/internal/const"
|
||||
"github.com/TeaOSLab/EdgeDNS/internal/events"
|
||||
@@ -45,6 +46,12 @@ func (this *StatManager) Start() {
|
||||
this.ticker = time.NewTicker(1 * time.Minute)
|
||||
}
|
||||
go func() {
|
||||
defer func() {
|
||||
if r := recover(); r != nil {
|
||||
remotelogs.Error("STAT", fmt.Sprintf("goroutine panic: %v", r))
|
||||
}
|
||||
}()
|
||||
|
||||
for range this.ticker.C {
|
||||
err := this.Loop()
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user