From 08ad84d8b2cca1230e175407a8d806620b94cfc3 Mon Sep 17 00:00:00 2001 From: Mitchell Hashimoto Date: Wed, 13 Apr 2016 12:02:24 -0700 Subject: [PATCH] command: defer the lock unlock --- command/hook_ui.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/command/hook_ui.go b/command/hook_ui.go index e1a1cb9a9..206dffe40 100644 --- a/command/hook_ui.go +++ b/command/hook_ui.go @@ -133,10 +133,11 @@ func (h *UiHook) PreApply( } func (h *UiHook) stillApplying(id string) { - // Grab the operation + // Grab the operation. We defer the lock here to avoid the "still..." + // message showing up after a completion message. h.l.Lock() + defer h.l.Unlock() state, ok := h.resources[id] - h.l.Unlock() // If the resource is out of the map it means we're done with it if !ok {