MCPcopy Index your code
hub / github.com/git-bug/git-bug / lock

Method lock

cache/repo_cache.go:170–189  ·  view source on GitHub ↗
(events chan BuildEvent)

Source from the content-addressed store, hash-verified

168}
169
170func (c *RepoCache) lock(events chan BuildEvent) error {
171 err := repoIsAvailable(c.repo, events)
172 if err != nil {
173 return err
174 }
175
176 f, err := c.repo.LocalStorage().Create(lockfile)
177 if err != nil {
178 return err
179 }
180
181 pid := fmt.Sprintf("%d", os.Getpid())
182 _, err = f.Write([]byte(pid))
183 if err != nil {
184 _ = f.Close()
185 return err
186 }
187
188 return f.Close()
189}
190
191func (c *RepoCache) Close() error {
192 var errWait multierr.ErrWaitGroup

Callers 1

NewNamedRepoCacheFunction · 0.95

Calls 4

repoIsAvailableFunction · 0.85
LocalStorageMethod · 0.65
CloseMethod · 0.65
WriteMethod · 0.45

Tested by

no test coverage detected