优化 代码

This commit is contained in:
dengsgo 2020-10-17 10:24:37 +08:00
parent 605914d1e1
commit 9e651d3023

View File

@ -30,7 +30,9 @@ func newTaskMan(delay int, callUrl string) *TaskMan {
go func() {
for {
<-t.waitChan
if len(t.waitQueue) > 0 {
if len(t.waitQueue) < 1 {
return
}
cf := t.waitQueue[len(t.waitQueue)-1]
if len(t.waitQueue) > 1 {
logInfo("redundant tasks dropped:", len(t.waitQueue)-1)
@ -38,7 +40,6 @@ func newTaskMan(delay int, callUrl string) *TaskMan {
t.waitQueue = []*changedFile{}
go t.preRun(cf)
}
}
}()
}