make StartAutoCommit to control background routine
This commit is contained in:
parent
c62e5d5aec
commit
17a2722004
1 changed files with 5 additions and 0 deletions
|
@ -14,6 +14,7 @@ import (
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/outputs"
|
"github.com/crowdsecurity/crowdsec/pkg/outputs"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/parser"
|
"github.com/crowdsecurity/crowdsec/pkg/parser"
|
||||||
"github.com/crowdsecurity/crowdsec/pkg/types"
|
"github.com/crowdsecurity/crowdsec/pkg/types"
|
||||||
|
"github.com/pkg/errors"
|
||||||
"github.com/sevlyar/go-daemon"
|
"github.com/sevlyar/go-daemon"
|
||||||
|
|
||||||
log "github.com/sirupsen/logrus"
|
log "github.com/sirupsen/logrus"
|
||||||
|
@ -163,6 +164,10 @@ func LoadOutputs(cConfig *csconfig.CrowdSec) error {
|
||||||
return fmt.Errorf("output plugins initialization error : %s", err.Error())
|
return fmt.Errorf("output plugins initialization error : %s", err.Error())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if err := OutputRunner.StartAutoCommit(); err != nil {
|
||||||
|
return errors.Wrap(err, "failed to start autocommit")
|
||||||
|
}
|
||||||
|
|
||||||
/* Init the API connector */
|
/* Init the API connector */
|
||||||
if cConfig.APIMode {
|
if cConfig.APIMode {
|
||||||
log.Infof("Loading API client")
|
log.Infof("Loading API client")
|
||||||
|
|
Loading…
Add table
Reference in a new issue