(events chan BuildEvent)
| 237 | } |
| 238 | |
| 239 | func (c *RepoCache) buildCache(events chan BuildEvent) { |
| 240 | events <- BuildEvent{Event: BuildEventCacheIsBuilt} |
| 241 | |
| 242 | var wg sync.WaitGroup |
| 243 | for _, subcache := range c.subcaches { |
| 244 | wg.Add(1) |
| 245 | go func(subcache cacheMgmt) { |
| 246 | defer wg.Done() |
| 247 | |
| 248 | buildEvents := subcache.Build() |
| 249 | for buildEvent := range buildEvents { |
| 250 | events <- buildEvent |
| 251 | if buildEvent.Err != nil { |
| 252 | return |
| 253 | } |
| 254 | } |
| 255 | }(subcache) |
| 256 | } |
| 257 | wg.Wait() |
| 258 | } |
| 259 | |
| 260 | // repoIsAvailable check is the given repository is locked by a Cache. |
| 261 | // Note: this is a smart function that will clean the lock file if the |
no test coverage detected