mirror of
https://github.com/yusing/godoxy.git
synced 2025-05-20 04:42:33 +02:00
fix notification dispatcher panic when dispatching on program exit
This commit is contained in:
parent
f7eb80a6ea
commit
66db583432
1 changed files with 6 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Reference in a new issue