Skip to content

Commit

Permalink
Fix by review
Browse files Browse the repository at this point in the history
Signed-off-by: Anton Sergunov <anton.sergunov@flant.com>
  • Loading branch information
asergunov committed Feb 24, 2025
1 parent edca6e2 commit 0c7b1ee
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions images/agent/src/internal/controller/llv/reconciler.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ type cleanupsKey struct {
}

type cleanupStatus struct {
cleanupRunning bool
failedMethod *string
cleanupRunning bool
prevFailedMethod *string
}
type cleanups struct {
m sync.RWMutex
m sync.Mutex
status map[cleanupsKey]cleanupStatus
}
type Reconciler struct {
Expand Down Expand Up @@ -105,7 +105,7 @@ func NewReconciler(
}
}

func (r *Reconciler) startCleanupRunning(vgName, lvName string) (inserted bool, failedMethod *string) {
func (r *Reconciler) startCleanupRunning(vgName, lvName string) (inserted bool, prevFailedMethod *string) {
r.runningCleanups.m.Lock()
defer r.runningCleanups.m.Unlock()
key := cleanupsKey{vgName: vgName, lvName: lvName}
Expand All @@ -115,7 +115,7 @@ func (r *Reconciler) startCleanupRunning(vgName, lvName string) (inserted bool,
}
value.cleanupRunning = true
r.runningCleanups.status[key] = value
return true, value.failedMethod
return true, value.prevFailedMethod
}

func (r *Reconciler) stopCleanupRunning(vgName, lvName string, failedMethod *string) error {
Expand All @@ -129,7 +129,7 @@ func (r *Reconciler) stopCleanupRunning(vgName, lvName string, failedMethod *str
if failedMethod == nil {
delete(r.runningCleanups.status, key)
} else {
value.failedMethod = failedMethod
value.prevFailedMethod = failedMethod
value.cleanupRunning = false
r.runningCleanups.status[key] = value
}
Expand Down

0 comments on commit 0c7b1ee

Please sign in to comment.