diff --git a/modules/gateway/agent.go b/modules/gateway/agent.go index 74b540bbf..b14188b33 100644 --- a/modules/gateway/agent.go +++ b/modules/gateway/agent.go @@ -321,8 +321,7 @@ func (this *Agent) messageDistribution(msg *pb.UserMessage) (err error) { } stime := time.Now() // this.gateway.Debugf("----------3 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) - // ctx, _ := context.WithTimeout(context.Background(), time.Second*5) - ctx := context.Background() + ctx, _ := context.WithTimeout(context.Background(), time.Second*5) if len(serviceTag) == 0 { // this.gateway.Debugf("----------4 agent:%s uId:%s MainType:%s SubType:%s ", this.sessionId, this.uId, msg.MainType, msg.SubType) if err = this.gateway.Service().RpcCall(ctx, servicePath, string(comm.Rpc_GatewayRoute), req, reply); err != nil { diff --git a/modules/worldtask/module.go b/modules/worldtask/module.go index ab50e3bb9..267b92c9a 100644 --- a/modules/worldtask/module.go +++ b/modules/worldtask/module.go @@ -8,6 +8,7 @@ import ( "go_dreamfactory/modules" "go_dreamfactory/pb" cfg "go_dreamfactory/sys/configure/structs" + "go_dreamfactory/utils" ) var _ comm.IWorldtask = (*Worldtask)(nil) @@ -89,7 +90,9 @@ func (this *Worldtask) TaskCondFinishNotify(session comm.IUserSession, condId in wt = &pb.Worldtask{} } - wt.CondiIds = append(wt.CondiIds, condId) + if _, ok := utils.Findx(wt.CondiIds, condId); !ok { + wt.CondiIds = append(wt.CondiIds, condId) + } userTask.CurrentTask[groupId] = wt