Chore: Remove context.TODO() (#43409)

* Remove context.TODO() from services

* Fix live test

* Remove context.TODO
This commit is contained in:
idafurjes
2021-12-22 11:02:42 +01:00
committed by GitHub
parent 2409d8dc1f
commit b8852ef6a3
45 changed files with 133 additions and 126 deletions

View File

@@ -114,7 +114,7 @@ func (m *PluginManager) init() error {
func (m *PluginManager) Run(ctx context.Context) error {
if m.cfg.CheckForUpdates {
go func() {
m.checkForUpdates()
m.checkForUpdates(ctx)
ticker := time.NewTicker(time.Minute * 10)
run := true
@@ -122,7 +122,7 @@ func (m *PluginManager) Run(ctx context.Context) error {
for run {
select {
case <-ticker.C:
m.checkForUpdates()
m.checkForUpdates(ctx)
case <-ctx.Done():
run = false
}

View File

@@ -20,7 +20,7 @@ type gcomPlugin struct {
Version string `json:"version"`
}
func (m *PluginManager) checkForUpdates() {
func (m *PluginManager) checkForUpdates(ctx context.Context) {
if !m.cfg.CheckForUpdates {
return
}
@@ -52,7 +52,7 @@ func (m *PluginManager) checkForUpdates() {
return
}
for _, localP := range m.Plugins(context.TODO()) {
for _, localP := range m.Plugins(ctx) {
for _, gcomP := range gcomPlugins {
if gcomP.Slug == localP.ID {
localP.GrafanaComVersion = gcomP.Version