Skip to content

Commit

Permalink
fixup! Keep a count of clones so we can cleanup clone when not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
komapa committed Nov 20, 2024
1 parent 5197ea1 commit 1ffa9aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions api/internal/git/cloner.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ type Cloner func(repoSpec *RepoSpec) error

var (
clones = make(map[string]filesys.ConfirmedDir)
cloneCount = make(map[filesys.ConfirmedDir]int)
cloneCount = make(map[filesys.ConfirmedDir]uint16)
cloneMutex sync.Mutex
)

Expand Down Expand Up @@ -78,7 +78,7 @@ func DoNothingCloner(dir filesys.ConfirmedDir) Cloner {
}

// DecrementCloneCount decrements the count of repoSpecs using a directory clone.
func DecrementCloneCount(dir filesys.ConfirmedDir) int {
func DecrementCloneCount(dir filesys.ConfirmedDir) uint16 {
cloneMutex.Lock()
defer cloneMutex.Unlock()

Expand Down

0 comments on commit 1ffa9aa

Please sign in to comment.