refactor: apkupdater: Lock on only critical section
This commit is contained in:
		
							parent
							
								
									fb405dc55c
								
							
						
					
					
						commit
						3941d4761d
					
				@ -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 {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user