(cacheKey string)
| 34 | } |
| 35 | |
| 36 | func (c *gitRepoCache) getLockForRepo(cacheKey string) *sync.Mutex { |
| 37 | c.mu.Lock() |
| 38 | defer c.mu.Unlock() |
| 39 | |
| 40 | if _, exists := c.locks[cacheKey]; !exists { |
| 41 | c.locks[cacheKey] = &sync.Mutex{} |
| 42 | } |
| 43 | |
| 44 | return c.locks[cacheKey] |
| 45 | } |
| 46 | |
| 47 | var globalGitRepoCache = &gitRepoCache{ |
| 48 | locks: make(map[string]*sync.Mutex), |