From 9c881a8ce153a0f140a163c12d5ba63dd794c7aa Mon Sep 17 00:00:00 2001 From: Steven Kaufer Date: Fri, 19 May 2017 13:21:46 -0500 Subject: [PATCH] Fix debug message when unable to get the terraform lock Message should have been in an `else` block. Signed-off-by: Steven Kaufer --- examples/instance/terraform/apply.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/instance/terraform/apply.go b/examples/instance/terraform/apply.go index 731ded7b0..73b65964a 100644 --- a/examples/instance/terraform/apply.go +++ b/examples/instance/terraform/apply.go @@ -26,8 +26,9 @@ func (p *plugin) terraformApply() error { if err := p.lock.TryLock(); err == nil { defer p.lock.Unlock() doTerraformApply(p.Dir) + } else { + log.Debugln("Can't acquire lock, waiting") } - log.Debugln("Can't acquire lock, waiting") time.Sleep(time.Duration(int64(rand.NormFloat64())%1000) * time.Millisecond) } }()