From 364e1ffa737398e0a28f8a5c4692af2615b640b3 Mon Sep 17 00:00:00 2001 From: Barnaby Keene Date: Sun, 16 Feb 2020 14:57:13 +0000 Subject: [PATCH] update gitwatch and add back the initial clone channel reads to ensure repos are cloned before continuing --- go.mod | 2 +- go.sum | 2 ++ service/reconfigure.go | 6 ++++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/go.mod b/go.mod index 71ace93..dc48c30 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/Southclaws/wadsworth go 1.13 require ( - github.com/Southclaws/gitwatch v1.3.1 + github.com/Southclaws/gitwatch v1.3.2 github.com/cpuguy83/go-md2man/v2 v2.0.0 // indirect github.com/frankban/quicktest v1.4.1 // indirect github.com/go-test/deep v1.0.2 // indirect diff --git a/go.sum b/go.sum index 6ff79c7..533081c 100644 --- a/go.sum +++ b/go.sum @@ -6,6 +6,8 @@ github.com/Southclaws/gitwatch v1.3.0 h1:oD++CTkgMoX7SEuk2/Vy6Y8iy7xFmsjKT7e6AiA github.com/Southclaws/gitwatch v1.3.0/go.mod h1:xCudUiwWxkDYZ69cEhlTwAKIzbG1OpnA/s/pjPIW6gU= github.com/Southclaws/gitwatch v1.3.1 h1:4XtiujsnxHKSKze3Tb5sWwTdBxSVW/JLbK54ruJ2nBU= github.com/Southclaws/gitwatch v1.3.1/go.mod h1:xCudUiwWxkDYZ69cEhlTwAKIzbG1OpnA/s/pjPIW6gU= +github.com/Southclaws/gitwatch v1.3.2 h1:zmt571n8ItXgkRJPyCFtFjcymvsFOGcm7JnHNpFDP+8= +github.com/Southclaws/gitwatch v1.3.2/go.mod h1:xCudUiwWxkDYZ69cEhlTwAKIzbG1OpnA/s/pjPIW6gU= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7 h1:uSoVVbwJiQipAclBbw+8quDsfcvFjOpI5iCf4p/cqCs= github.com/alcortesm/tgz v0.0.0-20161220082320-9c5fe88206d7/go.mod h1:6zEj6s6u/ghQa61ZWa/C2Aw3RkjiTBOix7dkqa1VLIs= github.com/anmitsu/go-shlex v0.0.0-20161002113705-648efa622239 h1:kFOfPq6dUM1hTo4JG6LR5AXSUEsOjtdm0kw0FtQtMJA= diff --git a/service/reconfigure.go b/service/reconfigure.go index dc4567c..bf0fe93 100644 --- a/service/reconfigure.go +++ b/service/reconfigure.go @@ -91,6 +91,8 @@ func (app *App) watchConfig() (err error) { }() zap.L().Debug("created new config watcher, awaiting setup") + <-app.configWatcher.InitialDone + return } @@ -129,6 +131,8 @@ func (app *App) watchTargets() (err error) { }() zap.L().Debug("created targets watcher, awaiting setup") + <-app.targetsWatcher.InitialDone + return } @@ -138,6 +142,8 @@ func getNewState(path, hostname string, fallback config.State) (state config.Sta state, err := config.ConfigFromDirectory(path, hostname) if err != nil { zap.L().Error("failed to construct config from repo, falling back to original state", + zap.String("path", path), + zap.String("hostname", hostname), zap.Error(err)) state = fallback