跨服处理
This commit is contained in:
parent
d905751909
commit
0936223d7f
@ -143,21 +143,15 @@ func (this *Mail) Reddot(session comm.IUserSession, rid ...comm.ReddotType) (red
|
||||
func (this *Mail) Rpc_Mail(ctx context.Context, args *pb.DBMailData, reply *pb.EmptyResp) (err error) {
|
||||
this.Debug("Rpc_Mail", log.Field{Key: "args", Value: args.String()})
|
||||
var (
|
||||
conn *db.DBConn
|
||||
session comm.IUserSession
|
||||
online bool
|
||||
)
|
||||
tag, _, b := utils.UIdSplit(args.Uid)
|
||||
if b {
|
||||
if conn, err = db.ServerDBConn(tag); err == nil {
|
||||
dbModel := db.NewDBModel(comm.TableMail, conn)
|
||||
_, err = dbModel.DB.InsertOne(comm.TableMail, args)
|
||||
|
||||
_, err = this.modelMail.DB.InsertOne(comm.TableMail, args)
|
||||
if err != nil {
|
||||
this.Error("Create Rpc_Mail failed", log.Field{Key: "uid", Value: args.Uid}, log.Field{Key: "err", Value: err.Error()})
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
defer func() {
|
||||
this.PutUserSession(session)
|
||||
}()
|
||||
|
Loading…
Reference in New Issue
Block a user