Commit 5be194e5 authored by hujiebin's avatar hujiebin

有err||uid不在线才入库

parent d1e920d9
......@@ -76,11 +76,14 @@ func SendDiamondChange(userId uint64, diamond, pinkDiamond uint32) error {
}
if buffer, err := proto.Marshal(msg); err == nil {
rspUids, err := multicast([]uint64{userId}, MsgDiamondChange, buffer)
//记录socket,注意闭包问题
go func(userId uint64, msg *userProxy.DiamondChange, rspUids []uint64, err error) {
buf, _ := json.Marshal(msg)
AddRpcLog(MsgDiamondChange, userId, string(buf[:]), rspUids, err)
}(userId, msg, rspUids, err)
// 记录socket
// 有err||uid不在线才入库
if err != nil || len(rspUids) > 0 {
go func(userId uint64, msg *userProxy.DiamondChange, rspUids []uint64, err error) {
buf, _ := json.Marshal(msg)
AddRpcLog(MsgDiamondChange, userId, string(buf[:]), rspUids, err)
}(userId, msg, rspUids, err)
}
if err != nil {
mylogrus.MyLog.Errorf("grpc SendDiamondChange send fail")
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment