1
0
镜像自地址 https://github.com/tuna/tunasync.git 已同步 2025-12-06 06:26:46 +00:00

Merge pull request #34 from tuna/dev

fix(worker): fix resource leakage caused by time.Tick(), closing #33
这个提交包含在:
bigeagle
2016-06-15 00:36:08 +08:00
提交者 GitHub
当前提交 8cb46476cf

查看文件

@@ -291,6 +291,7 @@ func (w *Worker) runSchedule() {
w.L.Unlock()
tick := time.Tick(5 * time.Second)
for {
select {
case jobMsg := <-w.managerChan:
@@ -326,7 +327,7 @@ func (w *Worker) runSchedule() {
w.schedule.AddJob(schedTime, job)
}
case <-time.Tick(5 * time.Second):
case <-tick:
// check schedule every 5 seconds
if job := w.schedule.Pop(); job != nil {
job.ctrlChan <- jobStart