don't wait for acquis tomb if we have no sources (#868)

This commit is contained in:
blotus 2021-07-28 08:58:44 +02:00 committed by GitHub
parent 34a4371dde
commit cedfca07c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -241,7 +241,11 @@ func StartAcquisition(sources []DataSource, output chan types.Event, AcquisTomb
return nil
})
}
/*return only when acquisition is over (cat) or never (tail)*/
err := AcquisTomb.Wait()
return err
// Don't wait if we have no sources, as it will hang forever
if len(sources) > 0 {
/*return only when acquisition is over (cat) or never (tail)*/
err := AcquisTomb.Wait()
return err
}
return nil
}