From 32c6fe744823f96eafe84d2b6c338acfb7e2d9c1 Mon Sep 17 00:00:00 2001 From: carabasdaniel Date: Mon, 5 Aug 2024 10:49:53 +0300 Subject: [PATCH] Only check bundle status if runtime is started --- plugins.go | 2 +- runtime.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins.go b/plugins.go index 569d89c..4ca156a 100644 --- a/plugins.go +++ b/plugins.go @@ -87,7 +87,7 @@ func (r *Runtime) pluginsLoaded() bool { continue } - if pluginName == bundlePluginName || status.State == plugins.StateNotReady { + if (pluginName == bundlePluginName || status.State == plugins.StateNotReady) && r.Started { bundles, err := r.GetBundles(timeoutCxt) if err == nil && len(bundles) > 0 { // if bundle plugin state is not ready after a reconfiguration, forcefully update plugin state if bundles are loaded. diff --git a/runtime.go b/runtime.go index ac21441..6aebb3f 100644 --- a/runtime.go +++ b/runtime.go @@ -438,8 +438,8 @@ func (r *Runtime) Start(ctx context.Context) error { // Stop - triggers plugin manager to stop all plugins. func (r *Runtime) Stop(ctx context.Context) { if r.Started { - r.pluginsManager.Stop(ctx) r.Started = false + r.pluginsManager.Stop(ctx) } }