From 288074c8b36fe72d4dfaee53083314d730869284 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sun, 13 Aug 2023 14:25:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E9=94=99=E8=AF=AF=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- internal/iplibrary/manager_ip_list.go | 2 +- internal/nodes/api_stream.go | 10 +++++++--- internal/nodes/task_ocsp_update.go | 6 +++++- 3 files changed, 13 insertions(+), 5 deletions(-) diff --git a/internal/iplibrary/manager_ip_list.go b/internal/iplibrary/manager_ip_list.go index 55d5de6..a06a414 100644 --- a/internal/iplibrary/manager_ip_list.go +++ b/internal/iplibrary/manager_ip_list.go @@ -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 diff --git a/internal/nodes/api_stream.go b/internal/nodes/api_stream.go index 7172602..9b4c4cb 100644 --- a/internal/nodes/api_stream.go +++ b/internal/nodes/api_stream.go @@ -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 } // 处理消息 diff --git a/internal/nodes/task_ocsp_update.go b/internal/nodes/task_ocsp_update.go index ae4b734..00e9e19 100644 --- a/internal/nodes/task_ocsp_update.go +++ b/internal/nodes/task_ocsp_update.go @@ -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()) + } } } }