fix bug in should-finish instruction

This commit is contained in:
ehlxr 2020-11-16 16:55:15 +08:00
parent 195740fa3d
commit b4ad1e0e96

View File

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