fix bug in should-finish instruction

main
ehlxr 2020-11-16 16:55:15 +08:00
parent 195740fa3d
commit b4ad1e0e96
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)
}
}()
}