From fc06037559055cf8c8ac262f8ad25c970bb37321 Mon Sep 17 00:00:00 2001 From: Eran Raichstein Date: Wed, 2 Mar 2022 17:29:54 +0200 Subject: [PATCH] move health.NewHealthServer before mainPipeline.Run --- cmd/flowlogs-pipeline/main.go | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmd/flowlogs-pipeline/main.go b/cmd/flowlogs-pipeline/main.go index 3b7e7d9ab..204a81c71 100644 --- a/cmd/flowlogs-pipeline/main.go +++ b/cmd/flowlogs-pipeline/main.go @@ -20,6 +20,11 @@ package main import ( "encoding/json" "fmt" + "os" + "path/filepath" + "strings" + "time" + jsoniter "github.com/json-iterator/go" "github.com/netobserv/flowlogs-pipeline/pkg/config" "github.com/netobserv/flowlogs-pipeline/pkg/health" @@ -29,10 +34,6 @@ import ( "github.com/spf13/cobra" "github.com/spf13/pflag" "github.com/spf13/viper" - "os" - "path/filepath" - "strings" - "time" ) var ( @@ -172,12 +173,12 @@ func run() { os.Exit(1) } - // Starts the flows pipeline - mainPipeline.Run() - // Start health report server health.NewHealthServer(mainPipeline) + // Starts the flows pipeline + mainPipeline.Run() + // Give all threads a chance to exit and then exit the process time.Sleep(time.Second) log.Debugf("exiting main run")