修复时间轮代码
This commit is contained in:
parent
0a17fb1517
commit
1c070e2646
@ -185,8 +185,9 @@ func (this *TimeWheel) handleTick() {
|
||||
}
|
||||
|
||||
if task.async {
|
||||
go func(task *Task) {
|
||||
go this.calltask(task, task.args...)
|
||||
go func(_task *Task) {
|
||||
this.calltask(_task, _task.args...)
|
||||
this.collectTask(task)
|
||||
}(task)
|
||||
|
||||
} else {
|
||||
@ -202,8 +203,10 @@ func (this *TimeWheel) handleTick() {
|
||||
}
|
||||
|
||||
// gc
|
||||
if !task.async {
|
||||
this.collectTask(task)
|
||||
}
|
||||
}
|
||||
|
||||
if this.currentIndex == this.bucketsNum-1 {
|
||||
this.currentIndex = 0
|
||||
|
Loading…
Reference in New Issue
Block a user