From 3941d4761dcd17ca48aeb104d1f6a6d740f26528 Mon Sep 17 00:00:00 2001 From: HeshamTB Date: Fri, 22 Sep 2023 01:31:49 +0300 Subject: [PATCH] refactor: apkupdater: Lock on only critical section --- apkupdater/apkupdater.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/apkupdater/apkupdater.go b/apkupdater/apkupdater.go index 3b7be44..ce955e0 100644 --- a/apkupdater/apkupdater.go +++ b/apkupdater/apkupdater.go @@ -60,9 +60,9 @@ type AlpineLinuxPackageUpdate struct { func (u *AlpineLinuxPackageUpdate) Update() { - u.apkLock.Lock() log.Println("Updating packages...") cmd := exec.Command("apk", u.Packages...) + u.apkLock.Lock() stdout, err := cmd.Output() u.apkLock.Unlock() if err != nil {