refactor: apkupdater: Lock on only critical section

This commit is contained in:
HeshamTB 2023-09-22 01:31:49 +03:00
parent fb405dc55c
commit 3941d4761d

View File

@ -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 {