优化错误日志处理

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 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, err

View File

@@ -50,7 +50,11 @@ func (this *APIStream) Start() {
}
err := this.loop()
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)
continue
}
@@ -76,7 +80,7 @@ func (this *APIStream) loop() error {
if this.isQuiting {
return nil
}
return errors.Wrap(err)
return err
}
this.stream = nodeStream
@@ -92,7 +96,7 @@ func (this *APIStream) loop() error {
remotelogs.Println("API_STREAM", "quit")
return nil
}
return errors.Wrap(err)
return err
}
// 处理消息

View File

@@ -53,7 +53,11 @@ func (this *OCSPUpdateTask) Start() {
for range this.ticker.C {
err := this.Loop()
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())
}
}
}
}