Skip to content

Commit

Permalink
Fix Issue #3
Browse files Browse the repository at this point in the history
  • Loading branch information
letsfire committed Nov 18, 2019
1 parent 5b15285 commit e76a76f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,14 @@ func newWorker() (w *worker) {
}
// 置为繁忙状态
atomic.StoreInt32(&w.isBusy, 1)
// 关闭任务通道
defer close(w.params)
// 可能存在任务
select {
case params := <-w.params:
w.action(params)
case <-time.Tick(time.Millisecond):
}
// 关闭任务通道
close(w.params)
}(w)
return
}

0 comments on commit e76a76f

Please sign in to comment.