Chore: Remove global bus variable (#50765)

* Chore: Remove global bus variable

* fix bus in tests
This commit is contained in:
Serge Zaitsev
2022-06-14 16:07:41 +02:00
committed by GitHub
parent 99c8ce5ab9
commit 0b55c41d05
15 changed files with 68 additions and 92 deletions

View File

@@ -5,6 +5,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 fmt.Errorf("%v: %w", "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 fmt.Errorf("%v: %w", "failed to initialize SQL store", err)
}