From 5a0d22474917609f3666b4a5a412b49e6982104b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BF=97=E5=AE=87?= Date: Mon, 9 Mar 2020 15:24:50 +0800 Subject: [PATCH] Fix #213 * Added defer statement to Updater.Update to revert u.updating value back to 0 after updating. --- pkg/util/updater/updater.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/util/updater/updater.go b/pkg/util/updater/updater.go index 92e54c8489..7f1db714af 100644 --- a/pkg/util/updater/updater.go +++ b/pkg/util/updater/updater.go @@ -75,6 +75,7 @@ func (u *Updater) Update() (err error) { if !atomic.CompareAndSwapUint32(&u.updating, 0, 1) { return ErrAlreadyStarted } + defer atomic.StoreUint32(&u.updating, 0) u.log.Infof("Looking for updates")