[v9.0.x] Chore: Remove global bus variable (#51126)

* Chore: Remove global bus variable (#50765)

* Chore: Remove global bus variable

* fix bus in tests

(cherry picked from commit 0b55c41d05)

* fix the imports
This commit is contained in:
Serge Zaitsev
2022-06-21 11:40:44 +02:00
committed by GitHub
parent 8522e2248c
commit 72c6512e3f
15 changed files with 69 additions and 92 deletions
+4 -1
View File
@@ -4,6 +4,7 @@ import (
"strings"
"github.com/fatih/color"
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/commands/datamigrations"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/commands/secretsmigrations"
"github.com/grafana/grafana/pkg/cmd/grafana-cli/logger"
@@ -55,7 +56,9 @@ func runDbCommand(command func(commandLine utils.CommandLine, sqlStore *sqlstore
return errutil.Wrap("failed to initialize tracer service", err)
}
sqlStore, err := sqlstore.ProvideService(cfg, nil, &migrations.OSSMigrations{}, tracer)
bus := bus.ProvideBus(tracer)
sqlStore, err := sqlstore.ProvideService(cfg, nil, &migrations.OSSMigrations{}, bus, tracer)
if err != nil {
return errutil.Wrap("failed to initialize SQL store", err)
}