Commit 459f98cf authored by mergify[bot]'s avatar mergify[bot] Committed by GitHub

Merge branch 'develop' into jm/streamline-migration/phase1

parents 8e76fac4 46a7b66f
...@@ -51,9 +51,10 @@ func Main(version string, cliCtx *cli.Context) error { ...@@ -51,9 +51,10 @@ func Main(version string, cliCtx *cli.Context) error {
return err return err
} }
} }
defer batchSubmitter.StopIfRunning(context.Background())
ctx, cancel := context.WithCancel(context.Background()) ctx, cancel := context.WithCancel(context.Background())
defer cancel() // Stop pprof and metrics only after main loop returns
defer batchSubmitter.StopIfRunning(context.Background())
pprofConfig := cfg.PprofConfig pprofConfig := cfg.PprofConfig
if pprofConfig.Enabled { if pprofConfig.Enabled {
...@@ -106,7 +107,8 @@ func Main(version string, cliCtx *cli.Context) error { ...@@ -106,7 +107,8 @@ func Main(version string, cliCtx *cli.Context) error {
syscall.SIGQUIT, syscall.SIGQUIT,
}...) }...)
<-interruptChannel <-interruptChannel
cancel() if err := server.Stop(); err != nil {
_ = server.Stop() l.Error("Error shutting down http server: %w", err)
}
return nil return nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment