From a16fe4d7c3755eba86b47c63a7a9744d99f6537a Mon Sep 17 00:00:00 2001 From: chriskaliX Date: Sat, 2 Dec 2023 21:49:21 +0800 Subject: [PATCH] agent: patch --- agent/plugin/plugin.go | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/agent/plugin/plugin.go b/agent/plugin/plugin.go index 4fd3aa7f..48bdb92a 100644 --- a/agent/plugin/plugin.go +++ b/agent/plugin/plugin.go @@ -38,11 +38,12 @@ func Startup(ctx context.Context, wg *sync.WaitGroup) { if cfg.Name == agent.Product { continue } - err := PluginManager.Load(ctx, *cfg) - if err == ErrAlreadyLoad { - zap.S().Infof("plugin %s has loaded already", cfg.Name) - } else { - zap.S().Errorf("plugin %s load failed: %s", cfg.Name, err.Error()) + if err := PluginManager.Load(ctx, *cfg); err != nil { + if err == ErrAlreadyLoad { + zap.S().Infof("plugin %s has loaded already", cfg.Name) + } else { + zap.S().Errorf("plugin %s load failed: %s", cfg.Name, err.Error()) + } } } // 移除插件