From dd90afd580636569c5b4e74a25b28175ff77348f Mon Sep 17 00:00:00 2001 From: Nathaniel Felsen Date: Sun, 21 Jan 2024 20:38:49 -0800 Subject: [PATCH] Fixing race condition preventing ansible to run on start depending on which go routine reaches runChan first. --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index de00158..f31c8df 100644 --- a/main.go +++ b/main.go @@ -314,7 +314,7 @@ func main() { } go func() { - runOnce() + runChan <- true // block until the first run is triggered if jitter == 0 { for range time.Tick(period) { runOnce()