move parseWG.done() after buildWG has been increased

This commit is contained in:
2022-01-21 13:02:22 +01:00
parent b9dec56a31
commit 79f7690a68

View File

@@ -53,6 +53,7 @@ func (b *BuildManager) buildWorker(id int, march string) {
return return
} else { } else {
b.buildWG.Add(1) b.buildWG.Add(1)
b.parseWG.Done()
} }
rand.Seed(time.Now().UnixNano()) rand.Seed(time.Now().UnixNano())
@@ -387,7 +388,6 @@ func (b *BuildManager) parseWorker() {
} }
b.build[pkg.March] <- pkg b.build[pkg.March] <- pkg
b.parseWG.Done()
} }
} }
} }
@@ -741,7 +741,6 @@ func (b *BuildManager) syncWorker() {
} }
b.parseWG.Wait() b.parseWG.Wait()
time.Sleep(time.Second * 70)
b.buildWG.Wait() b.buildWG.Wait()
if !b.exit { if !b.exit {
@@ -753,7 +752,7 @@ func (b *BuildManager) syncWorker() {
} }
} }
time.Sleep(time.Duration(*checkInterval-1) * time.Minute) time.Sleep(time.Duration(*checkInterval) * time.Minute)
} }
} }