This commit is contained in:
wangchuxiao
2022-05-27 10:26:44 +08:00
parent 098f8a52f7
commit f5befcc95f
5 changed files with 18 additions and 15 deletions
+4 -1
View File
@@ -5,7 +5,9 @@ import (
"Open_IM/pkg/common/config"
"Open_IM/pkg/common/constant"
"Open_IM/pkg/common/http"
"Open_IM/pkg/common/log"
commonPb "Open_IM/pkg/proto/sdk_ws"
"Open_IM/pkg/utils"
http2 "net/http"
)
@@ -24,10 +26,11 @@ func callbackOfflinePush(operationID, userID string, info *commonPb.OfflinePushI
},
OfflinePushInfo: info,
}
callbackOfflinePushResp := &cbApi.CallbackOfflinePushResp{CommonCallbackResp: callbackResp}
callbackOfflinePushResp := &cbApi.CallbackOfflinePushResp{CommonCallbackResp: &callbackResp}
if err := http.PostReturn(config.Config.Callback.CallbackUrl, callbackOfflinePushReq, callbackOfflinePushResp, config.Config.Callback.CallbackOfflinePush.CallbackTimeOut); err != nil {
callbackResp.ErrCode = http2.StatusInternalServerError
callbackResp.ErrMsg = err.Error()
}
log.NewDebug(operationID, utils.GetSelfFuncName(), callbackOfflinePushResp)
return callbackResp
}
+1
View File
@@ -111,6 +111,7 @@ func MsgToUser(pushMsg *pbPush.PushMsgReq) {
log.NewError(pushMsg.OperationID, utils.GetSelfFuncName(), "callbackOfflinePush result: ", callbackResp)
}
if callbackResp.ActionCode != constant.ActionAllow {
log.NewDebug(pushMsg.OperationID, utils.GetSelfFuncName(), "offline push was stop")
break
}