MCPcopy Create free account
hub / github.com/AdRoll/baker / Run

Method Run

input/list.go:393–418  ·  view source on GitHub ↗
(inch chan<- *baker.Data)

Source from the content-addressed store, hash-verified

391}
392
393func (s *List) Run(inch chan<- *baker.Data) error {
394 s.ci.SetOutputChannel(inch)
395
396 for _, f := range s.Cfg.Files {
397 s.processFileOrList(f)
398 if ferr := s.fatalErr.Load(); ferr != nil {
399 // Even if we've got a fatal error, wait for
400 // completion of compressedStream so that we're sure
401 // all workers are exited. Otherwise, we might
402 // cauase race-conditions in callers because
403 // we haven't actually finished pushing things
404 // into the output channel.
405 break
406 }
407 }
408
409 // Now wait until we've finished processing all the files
410 s.ci.NoMoreFiles()
411 <-s.ci.Done
412
413 log.WithFields(log.Fields{"f": "List.Run"}).Info("terminating")
414 if ferr := s.fatalErr.Load(); ferr != nil {
415 return ferr.(error)
416 }
417 return nil
418}
419
420func (s *List) FreeMem(data *baker.Data) {
421 s.ci.FreeMem(data)

Callers 5

TestListBasicFunction · 0.95
TestListInvalidStdinFunction · 0.95
TestListS3FolderFunction · 0.95
TestListS3ManifestFunction · 0.95
TestListHttpFileFunction · 0.95

Calls 4

processFileOrListMethod · 0.95
SetOutputChannelMethod · 0.80
LoadMethod · 0.80
NoMoreFilesMethod · 0.80

Tested by 5

TestListBasicFunction · 0.76
TestListInvalidStdinFunction · 0.76
TestListS3FolderFunction · 0.76
TestListS3ManifestFunction · 0.76
TestListHttpFileFunction · 0.76