Skip to content

Commit

Permalink
Merge pull request #70 from SovereignCloudStack/kr/defer-mutex
Browse files Browse the repository at this point in the history
🐛 defer unlocking of mutex
  • Loading branch information
kranurag7 authored and kranurag7 committed Apr 24, 2024
2 parents 35d657a + 14f2e8c commit d7a944d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions internal/controller/clusterstackrelease_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,8 @@ func (r *ClusterStackReleaseReconciler) Reconcile(ctx context.Context, req recon
// acquire lock so that only one reconcile loop can download the release
r.clusterStackRelDownloadDirectoryMutex.Lock()

defer r.clusterStackRelDownloadDirectoryMutex.Unlock()

gc, err := r.GitHubClientFactory.NewClient(ctx)
if err != nil {
conditions.MarkFalse(clusterStackRelease,
Expand All @@ -131,8 +133,6 @@ func (r *ClusterStackReleaseReconciler) Reconcile(ctx context.Context, req recon
return reconcile.Result{}, fmt.Errorf("failed to download release assets: %w", err)
}

r.clusterStackRelDownloadDirectoryMutex.Unlock()

// requeue to make sure release assets can be accessed
return reconcile.Result{Requeue: true}, nil
}
Expand Down

0 comments on commit d7a944d

Please sign in to comment.