This commit is contained in:
meixiongfeng 2024-01-10 10:14:59 +08:00
commit 9b300608f6
2 changed files with 13 additions and 0 deletions

View File

@ -38,6 +38,10 @@ func (this *apiComp) Info(session comm.IUserSession, req *pb.BuriedInfoReq) (err
for _, items := range buried.Items {
for _, v := range items.Condi {
if conf, err = this.module.configure.getburiedcondidata(v.Conid); err != nil {
errdata = &pb.ErrorData{
Code: pb.ErrorCode_ConfigNoFound,
Message: err.Error(),
}
return
}
conditions = append(conditions, comm.GetBuriedConIProgress(conf, v))

View File

@ -7,6 +7,7 @@ import (
"go_dreamfactory/lego/base"
"go_dreamfactory/lego/core"
"go_dreamfactory/lego/core/cbase"
"runtime"
"time"
"go_dreamfactory/lego/sys/log"
@ -983,6 +984,14 @@ func (this *ModuleBase) FormatRes(res []*cfg.Gameatn) (ret []*cfg.Gameatn) {
//异步调用用户处理流
func (this *ModuleBase) AsynHandleSession(session comm.IUserSession, handle func(session comm.IUserSession)) {
defer func() { //程序异常 收集异常信息传递给前端显示
if r := recover(); r != nil {
buf := make([]byte, 4096)
l := runtime.Stack(buf, false)
err := fmt.Errorf("%v: %s", r, buf[:l])
log.Errorf("[AsynHandleSession] err:%s", err.Error())
}
}()
handle(session)
session.Push()
this.PutUserSession(session)