From b3531362cafedd3c93c0e5311b8a950db7b17820 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Torkel=20=C3=96degaard?= Date: Fri, 27 Apr 2018 21:22:29 +0200 Subject: [PATCH] fix: minor fix to plugin service shut down flow --- pkg/plugins/plugins.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/pkg/plugins/plugins.go b/pkg/plugins/plugins.go index 7ce0ac38919..8ccdb9cf18b 100644 --- a/pkg/plugins/plugins.go +++ b/pkg/plugins/plugins.go @@ -111,11 +111,14 @@ func (pm *PluginManager) Run(ctx context.Context) error { pm.checkForUpdates() ticker := time.NewTicker(time.Minute * 10) - for { + run := true + + for run { select { case <-ticker.C: pm.checkForUpdates() case <-ctx.Done(): + run = false break } } @@ -125,7 +128,7 @@ func (pm *PluginManager) Run(ctx context.Context) error { p.Kill() } - return nil + return ctx.Err() } func checkPluginPaths() error {