上传任务锁代码
This commit is contained in:
parent
fc391d0a91
commit
1cd38733aa
@ -266,7 +266,6 @@ func (this *ModuleRtask) getHandle(tt comm.TaskType) (condis []*rtaskCondHandle)
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
// 处理触发的任务
|
||||
func (this *ModuleRtask) processOneTask(session comm.IUserSession, rtaskType comm.TaskType, params ...int32) (code pb.ErrorCode) {
|
||||
uid := session.GetUserId()
|
||||
@ -290,6 +289,13 @@ 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)
|
||||
@ -369,13 +375,6 @@ func (this *ModuleRtask) TriggerTask(uid string, taskParams ...*comm.TaskParam)
|
||||
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()
|
||||
|
||||
for _, tp := range taskParams {
|
||||
this.Debug("任务触发",
|
||||
log.Field{Key: "uid", Value: uid},
|
||||
|
Loading…
Reference in New Issue
Block a user