diff --git a/internal/notif/dispatcher.go b/internal/notif/dispatcher.go index b354af41..d38d261b 100644 --- a/internal/notif/dispatcher.go +++ b/internal/notif/dispatcher.go @@ -49,7 +49,12 @@ func Notify(msg *LogMessage) { if dispatcher == nil { return } - dispatcher.logCh <- msg + select { + case <-dispatcher.task.Context().Done(): + return + default: + dispatcher.logCh <- msg + } } func (disp *Dispatcher) RegisterProvider(cfg types.NotificationConfig) (Provider, E.Error) {