浏览代码

fix: minor fix to plugin service shut down flow

Torkel Ödegaard 7 年之前
父节点
当前提交
b3531362ca
共有 1 个文件被更改,包括 5 次插入2 次删除
  1. 5 2
      pkg/plugins/plugins.go

+ 5 - 2
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 {