mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-26 11:01:07 +01:00
fix notification dispatcher panic when dispatching on program exit
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user