mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Remove context.TODO() (#43409)
* Remove context.TODO() from services * Fix live test * Remove context.TODO
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user