From ab99be68e839e84cf9ae28f530bf835c3faf90b5 Mon Sep 17 00:00:00 2001 From: wangchuxiao Date: Fri, 9 Jun 2023 19:19:27 +0800 Subject: [PATCH] callback log --- internal/rpc/msg/send.go | 1 + pkg/common/http/http_client.go | 8 ++++---- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/internal/rpc/msg/send.go b/internal/rpc/msg/send.go index 89f015315..8b2467846 100644 --- a/internal/rpc/msg/send.go +++ b/internal/rpc/msg/send.go @@ -72,6 +72,7 @@ func (m *msgServer) sendMsgNotification(ctx context.Context, req *pbMsg.SendMsgR } func (m *msgServer) sendMsgSingleChat(ctx context.Context, req *pbMsg.SendMsgReq) (resp *pbMsg.SendMsgResp, err error) { + defer log.ZDebug(ctx, "sendMsgSingleChat return line") promePkg.Inc(promePkg.SingleChatMsgRecvSuccessCounter) if err := m.messageVerification(ctx, req); err != nil { return nil, err diff --git a/pkg/common/http/http_client.go b/pkg/common/http/http_client.go index 9f4349bb5..1f64c5ef9 100644 --- a/pkg/common/http/http_client.go +++ b/pkg/common/http/http_client.go @@ -89,15 +89,15 @@ func callBackPostReturn(ctx context.Context, url, command string, input interfac b, err := Post(ctx, url, nil, input, callbackConfig.CallbackTimeOut) if err != nil { if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue { - log.ZWarn(ctx, "callback failed but continue", err, "url", url, "err", err.Error()) - return nil + log.ZWarn(ctx, "callback failed but continue", err, "url", url) + return errs.ErrCallbackContinue } return errs.ErrNetwork.Wrap(err.Error()) } if err = json.Unmarshal(b, output); err != nil { if callbackConfig.CallbackFailedContinue != nil && *callbackConfig.CallbackFailedContinue { - log.ZWarn(ctx, "callback failed but continue", err, "url", url, "err", err.Error()) - return nil + log.ZWarn(ctx, "callback failed but continue", err, "url", url) + return errs.ErrCallbackContinue } return errs.ErrData.Wrap(err.Error()) }