From 644d0fe955a50bc63b1572eb7e8c37f308645a21 Mon Sep 17 00:00:00 2001 From: sabban <15465465+sabban@users.noreply.github.com> Date: Fri, 20 May 2022 14:40:10 +0200 Subject: [PATCH] non-blocking send --- pkg/csplugin/watcher.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pkg/csplugin/watcher.go b/pkg/csplugin/watcher.go index f0b185e57..6d1375bb5 100644 --- a/pkg/csplugin/watcher.go +++ b/pkg/csplugin/watcher.go @@ -134,7 +134,10 @@ func (pw *PluginWatcher) watchPluginTicker(pluginName string) { } case <-pw.tomb.Dying(): ticker.Stop() - pw.PluginEvents <- pluginName + select { + case pw.PluginEvents <- pluginName: + default: + } log.Tracef("sending alerts to %s", pluginName) return }