跨服处理
This commit is contained in:
parent
d905751909
commit
0936223d7f
@ -143,20 +143,14 @@ 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) {
|
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()})
|
this.Debug("Rpc_Mail", log.Field{Key: "args", Value: args.String()})
|
||||||
var (
|
var (
|
||||||
conn *db.DBConn
|
|
||||||
session comm.IUserSession
|
session comm.IUserSession
|
||||||
online bool
|
online bool
|
||||||
)
|
)
|
||||||
tag, _, b := utils.UIdSplit(args.Uid)
|
|
||||||
if b {
|
_, err = this.modelMail.DB.InsertOne(comm.TableMail, args)
|
||||||
if conn, err = db.ServerDBConn(tag); err == nil {
|
if err != nil {
|
||||||
dbModel := db.NewDBModel(comm.TableMail, conn)
|
this.Error("Create Rpc_Mail failed", log.Field{Key: "uid", Value: args.Uid}, log.Field{Key: "err", Value: err.Error()})
|
||||||
_, err = dbModel.DB.InsertOne(comm.TableMail, args)
|
return
|
||||||
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() {
|
defer func() {
|
||||||
this.PutUserSession(session)
|
this.PutUserSession(session)
|
||||||
|
Loading…
Reference in New Issue
Block a user