diff --git a/modules/rtask/module.go b/modules/rtask/module.go index 406b0a10c..b7d28f309 100644 --- a/modules/rtask/module.go +++ b/modules/rtask/module.go @@ -176,7 +176,7 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle case comm.Rtype25, comm.Rtype30, comm.Rtype32, comm.Rtype33, comm.Rtype34, comm.Rtype36, comm.Rtype37, comm.Rtype40, - comm.Rtype46, comm.Rtype76, comm.Rtype79, + comm.Rtype46, comm.Rtype76, comm.Rtype79, comm.Rtype52, comm.Rtype55, comm.Rtype56, comm.Rtype82, comm.Rtype65, comm.Rtype66, comm.Rtype67, comm.Rtype68, comm.Rtype70, comm.Rtype140, comm.Rtype169, comm.Rtype170, comm.Rtype174, comm.Rtype179, comm.Rtype180: @@ -187,7 +187,7 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (handles []*rtaskCondHandle } handles = append(handles, handle) this.registerVerifyHandle(v.Id, handle) - case comm.Rtype73, comm.Rtype77,comm.Rtype80, comm.Rtype83: + case comm.Rtype73, comm.Rtype77, comm.Rtype80, comm.Rtype83: handle := &rtaskCondHandle{ condId: v.Id, verify: this.modelRtaskRecord.verifyThirdGreatEqualParam, @@ -249,13 +249,6 @@ func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType com return } - lock, _ := this.modelRtask.userlock(uid) - err := lock.Lock() - if err != nil { - this.Error("TriggerTask userlock err!", log.Field{Key: "err", Value: err.Error()}) - } - defer lock.Unlock() - record := this.modelRtaskRecord.getRecord(uid) handles = this.getHandle(rtaskType) @@ -372,6 +365,12 @@ func (this *ModuleRtask) TriggerTask(uid string, taskParams ...*comm.TaskParam) this.Debug("任务触发", log.Field{Key: "uid", Value: uid}, log.Field{Key: "tasks", Value: taskParams}) + lock, _ := this.modelRtask.userlock(uid) + err := lock.Lock() + if err != nil { + this.Error("TriggerTask userlock err!", log.Field{Key: "err", Value: err.Error()}) + } + defer lock.Unlock() for _, tp := range taskParams { // this.Debug("任务触发", // log.Field{Key: "uid", Value: uid},