From d4395aeec33fcaf2deef77d3278035586f0a5b3a Mon Sep 17 00:00:00 2001 From: Sofia Papagiannaki <1632407+papagian@users.noreply.github.com> Date: Fri, 15 Aug 2025 11:48:06 +0300 Subject: [PATCH] Chore: Use cli.Context instead of background context in RunServer function (#109553) Use cli.Context instead of background context in RunServer function --- pkg/cmd/grafana-server/commands/cli.go | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/pkg/cmd/grafana-server/commands/cli.go b/pkg/cmd/grafana-server/commands/cli.go index 57083f93fd2..8850132105f 100644 --- a/pkg/cmd/grafana-server/commands/cli.go +++ b/pkg/cmd/grafana-server/commands/cli.go @@ -106,15 +106,13 @@ func RunServer(opts standalone.BuildInfo, cli *cli.Context) error { metrics.SetBuildInformation(metrics.ProvideRegisterer(), opts.Version, opts.Commit, opts.BuildBranch, getBuildstamp(opts)) - ctx := context.Background() - // Initialize the OpenFeature feature flag system if err := featuremgmt.InitOpenFeatureWithCfg(cfg); err != nil { return err } s, err := server.Initialize( - ctx, + cli.Context, cfg, server.Options{ PidFile: PidFile, @@ -128,7 +126,7 @@ func RunServer(opts standalone.BuildInfo, cli *cli.Context) error { return err } - go listenToSystemSignals(ctx, s) + go listenToSystemSignals(cli.Context, s) return s.Run() }