don't wait on tomb if no datasources were started (#1019)
This commit is contained in:
parent
3f99330b3d
commit
76a80380e7
|
@ -104,11 +104,13 @@ func ShutdownCrowdsecRoutines() error {
|
||||||
var reterr error
|
var reterr error
|
||||||
|
|
||||||
log.Debugf("Shutting down crowdsec sub-routines")
|
log.Debugf("Shutting down crowdsec sub-routines")
|
||||||
acquisTomb.Kill(nil)
|
if len(dataSources) > 0 {
|
||||||
log.Debugf("waiting for acquisition to finish")
|
acquisTomb.Kill(nil)
|
||||||
if err := acquisTomb.Wait(); err != nil {
|
log.Debugf("waiting for acquisition to finish")
|
||||||
log.Warningf("Acquisition returned error : %s", err)
|
if err := acquisTomb.Wait(); err != nil {
|
||||||
reterr = err
|
log.Warningf("Acquisition returned error : %s", err)
|
||||||
|
reterr = err
|
||||||
|
}
|
||||||
}
|
}
|
||||||
log.Debugf("acquisition is finished, wait for parser/bucket/ouputs.")
|
log.Debugf("acquisition is finished, wait for parser/bucket/ouputs.")
|
||||||
parsersTomb.Kill(nil)
|
parsersTomb.Kill(nil)
|
||||||
|
|
Loading…
Reference in a new issue