fix bug in should-finish instruction

main^2
ehlxr 2020-11-16 16:58:56 +08:00
parent bf4f156714
commit ecf0676d67
1 changed files with 7 additions and 8 deletions

View File

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