|
4 | 4 | "context" |
5 | 5 | "fmt" |
6 | 6 | "strconv" |
| 7 | + "os" |
7 | 8 | "time" |
8 | 9 |
|
9 | 10 | log "github.com/sirupsen/logrus" |
@@ -97,12 +98,12 @@ func startHeartBeat(ctx context.Context, _ *csconfig.Config, apiClient *apiclien |
97 | 98 | apiClient.HeartBeat.StartHeartBeat(ctx) |
98 | 99 | } |
99 | 100 |
|
100 | | -func startOutputRoutines(ctx context.Context, cConfig *csconfig.Config, parsers *parser.Parsers, apiClient *apiclient.ApiClient, stageCollector *parser.StageParseCollector, bucketOverflows []pipeline.Event) { |
| 101 | +func startOutputRoutines(ctx context.Context, cConfig *csconfig.Config, parsers *parser.Parsers, apiClient *apiclient.ApiClient, sd *StateDumper) { |
101 | 102 | for idx := range cConfig.Crowdsec.OutputRoutinesCount { |
102 | 103 | log.WithField("idx", idx).Info("Starting output routine") |
103 | 104 | outputsTomb.Go(func() error { |
104 | 105 | defer trace.CatchPanic("crowdsec/runOutput/"+strconv.Itoa(idx)) |
105 | | - return runOutput(ctx, inEvents, outEvents, buckets, *parsers.PovfwCtx, parsers.Povfwnodes, apiClient, stageCollector, bucketOverflows) |
| 106 | + return runOutput(ctx, inEvents, outEvents, buckets, *parsers.PovfwCtx, parsers.Povfwnodes, apiClient, sd) |
106 | 107 | }) |
107 | 108 | } |
108 | 109 | } |
@@ -157,7 +158,7 @@ func runCrowdsec( |
157 | 158 |
|
158 | 159 | startHeartBeat(ctx, cConfig, apiClient) |
159 | 160 |
|
160 | | - startOutputRoutines(ctx, cConfig, parsers, apiClient, sd.StageParse, sd.BucketOverflows) |
| 161 | + startOutputRoutines(ctx, cConfig, parsers, apiClient, sd) |
161 | 162 |
|
162 | 163 | if err := startLPMetrics(ctx, cConfig, apiClient, hub, datasources); err != nil { |
163 | 164 | return err |
@@ -222,7 +223,7 @@ func serveCrowdsec( |
222 | 223 | log.Fatal(err) |
223 | 224 | } |
224 | 225 |
|
225 | | - return nil |
| 226 | + os.Exit(0) |
226 | 227 | } |
227 | 228 |
|
228 | 229 | return nil |
|
0 commit comments