mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-28 11:47:42 +02: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 {
|
if dispatcher == nil {
|
||||||
return
|
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) {
|
func (disp *Dispatcher) RegisterProvider(cfg types.NotificationConfig) (Provider, E.Error) {
|
||||||
|
|||||||
Reference in New Issue
Block a user