From 959db7d29e1e62de9e6333041c14cbb14555c1fb Mon Sep 17 00:00:00 2001 From: zong-zhe Date: Tue, 18 Jul 2023 17:21:45 +0800 Subject: [PATCH] fix: fix CR comments. --- pkg/settings/settings.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/settings/settings.go b/pkg/settings/settings.go index adec490c..600b13bb 100644 --- a/pkg/settings/settings.go +++ b/pkg/settings/settings.go @@ -66,15 +66,15 @@ func (settings *Settings) AcquirePackageCacheLock() error { if err != nil { return err } - firstTry := true + // if failed to lock the 'package-cache' file, wait until it is unlocked. if !locked { + reporter.Report("kpm: waiting for package-cache lock...") for { // try to lock the 'package-cache' file locked, err = settings.PackageCacheLock.TryLock() - if err != nil && firstTry { - reporter.Report("kpm: waiting for package-cache lock...") - firstTry = false + if err != nil { + return err } // if locked, break the loop. if locked {