From 79f7690a68de0bda14acc64fc6c414ddb1e3f30e Mon Sep 17 00:00:00 2001 From: Giovanni Harting <539@idlegandalf.com> Date: Fri, 21 Jan 2022 13:02:22 +0100 Subject: [PATCH] move parseWG.done() after buildWG has been increased --- main.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/main.go b/main.go index 3c4784d..d864e6d 100644 --- a/main.go +++ b/main.go @@ -53,6 +53,7 @@ func (b *BuildManager) buildWorker(id int, march string) { return } else { b.buildWG.Add(1) + b.parseWG.Done() } rand.Seed(time.Now().UnixNano()) @@ -387,7 +388,6 @@ func (b *BuildManager) parseWorker() { } b.build[pkg.March] <- pkg - b.parseWG.Done() } } } @@ -741,7 +741,6 @@ func (b *BuildManager) syncWorker() { } b.parseWG.Wait() - time.Sleep(time.Second * 70) b.buildWG.Wait() 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) } }