callback log

test-errcode
wangchuxiao 1 year ago
parent 2c0ec630fd
commit ab99be68e8

@ -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

@ -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())
}

Loading…
Cancel
Save