优化错误日志处理

This commit is contained in:
刘祥超
2023-08-13 14:25:59 +08:00
parent 0a290251cd
commit 288074c8b3
3 changed files with 13 additions and 5 deletions

View File

@@ -187,7 +187,7 @@ func (this *IPListManager) fetch() (hasNext bool, err error) {
}) })
if err != nil { if err != nil {
if rpc.IsConnError(err) { if rpc.IsConnError(err) {
remotelogs.Warn("IP_LIST_MANAGER", "rpc connection error: "+err.Error()) remotelogs.Debug("IP_LIST_MANAGER", "rpc connection error: "+err.Error())
return false, nil return false, nil
} }
return false, err return false, err

View File

@@ -50,7 +50,11 @@ func (this *APIStream) Start() {
} }
err := this.loop() err := this.loop()
if err != nil { if err != nil {
remotelogs.Warn("API_STREAM", err.Error()) if rpc.IsConnError(err) {
remotelogs.Debug("API_STREAM", err.Error())
} else {
remotelogs.Warn("API_STREAM", err.Error())
}
time.Sleep(10 * time.Second) time.Sleep(10 * time.Second)
continue continue
} }
@@ -76,7 +80,7 @@ func (this *APIStream) loop() error {
if this.isQuiting { if this.isQuiting {
return nil return nil
} }
return errors.Wrap(err) return err
} }
this.stream = nodeStream this.stream = nodeStream
@@ -92,7 +96,7 @@ func (this *APIStream) loop() error {
remotelogs.Println("API_STREAM", "quit") remotelogs.Println("API_STREAM", "quit")
return nil return nil
} }
return errors.Wrap(err) return err
} }
// 处理消息 // 处理消息

View File

@@ -53,7 +53,11 @@ func (this *OCSPUpdateTask) Start() {
for range this.ticker.C { for range this.ticker.C {
err := this.Loop() err := this.Loop()
if err != nil { if err != nil {
remotelogs.Warn("OCSPUpdateTask", "update ocsp failed: "+err.Error()) if rpc.IsConnError(err) {
remotelogs.Debug("OCSPUpdateTask", "update ocsp failed: "+err.Error())
} else {
remotelogs.Warn("OCSPUpdateTask", "update ocsp failed: "+err.Error())
}
} }
} }
} }