fix: keep friend request success when event publish fails
This commit is contained in:
+2
-2
@@ -4696,8 +4696,8 @@ func serveIMFriendRequestCreate(wrt http.ResponseWriter, req *http.Request) {
|
||||
if imReliableHTTPEventsEnabled(req) {
|
||||
if err = publishIMRelationEvent(principal.TenantID, principal.Uid, target, created.RequestID,
|
||||
"friend.request.created", "新的好友申请", message); err != nil {
|
||||
writeIMError(wrt, req, http.StatusInternalServerError, 90000, imReasonInternal, "internal error", nil)
|
||||
return
|
||||
logs.Warn.Printf("im friend request create: relation event failed request_id=%s friend_request_id=%s target=%s: %v",
|
||||
req.Header.Get("X-Request-ID"), created.RequestID, target.UserId(), err)
|
||||
}
|
||||
}
|
||||
writeIMSuccess(wrt, req, friendRequestPayload(created))
|
||||
|
||||
Reference in New Issue
Block a user