mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-26 03:26:57 +08:00
Merge remote-tracking branch 'origin/tuoyun' into tuoyun
This commit is contained in:
commit
f92b7ea86b
@ -19,31 +19,28 @@ func (rpc *rpcChat) GetMaxAndMinSeq(_ context.Context, in *pbMsg.GetMaxAndMinSeq
|
|||||||
maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID)
|
maxSeq, err1 := commonDB.DB.GetUserMaxSeq(in.UserID)
|
||||||
minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID)
|
minSeq, err2 := commonDB.DB.GetUserMinSeq(in.UserID)
|
||||||
resp := new(pbMsg.GetMaxAndMinSeqResp)
|
resp := new(pbMsg.GetMaxAndMinSeqResp)
|
||||||
if err1 == nil && err2 == nil {
|
if err1 == nil {
|
||||||
resp.MaxSeq = maxSeq
|
resp.MaxSeq = maxSeq
|
||||||
resp.MinSeq = minSeq
|
} else if err1 == redis.ErrNil {
|
||||||
resp.ErrCode = 0
|
|
||||||
resp.ErrMsg = ""
|
|
||||||
return resp, nil
|
|
||||||
} else {
|
|
||||||
if err1 == redis.ErrNil {
|
|
||||||
resp.MaxSeq = 0
|
resp.MaxSeq = 0
|
||||||
} else if err1 != nil {
|
} else {
|
||||||
log.NewInfo(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error())
|
log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err1.Error())
|
||||||
resp.MaxSeq = -1
|
resp.MaxSeq = -1
|
||||||
|
resp.ErrCode = 200
|
||||||
|
resp.ErrMsg = "redis get err"
|
||||||
}
|
}
|
||||||
if err2 == redis.ErrNil {
|
if err2 == nil {
|
||||||
|
resp.MinSeq = minSeq
|
||||||
|
} else if err2 == redis.ErrNil {
|
||||||
resp.MinSeq = 0
|
resp.MinSeq = 0
|
||||||
} else if err2 != nil {
|
} else {
|
||||||
log.NewInfo(in.OperationID, "getMinSeq from redis error", in.String(), err2.Error())
|
log.NewError(in.OperationID, "getMaxSeq from redis error", in.String(), err2.Error())
|
||||||
resp.MinSeq = -1
|
resp.MinSeq = -1
|
||||||
|
resp.ErrCode = 201
|
||||||
|
resp.ErrMsg = "redis get err"
|
||||||
}
|
}
|
||||||
resp.ErrCode = 0
|
|
||||||
resp.ErrMsg = ""
|
|
||||||
return resp, nil
|
return resp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
|
||||||
func (rpc *rpcChat) PullMessage(_ context.Context, in *pbMsg.PullMessageReq) (*pbMsg.PullMessageResp, error) {
|
func (rpc *rpcChat) PullMessage(_ context.Context, in *pbMsg.PullMessageReq) (*pbMsg.PullMessageResp, error) {
|
||||||
log.InfoByKv("rpc pullMessage is arriving", in.OperationID, "args", in.String())
|
log.InfoByKv("rpc pullMessage is arriving", in.OperationID, "args", in.String())
|
||||||
resp := new(pbMsg.PullMessageResp)
|
resp := new(pbMsg.PullMessageResp)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user