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,8 +49,13 @@ func Notify(msg *LogMessage) {
|
||||||
if dispatcher == nil {
|
if dispatcher == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
select {
|
||||||
|
case <-dispatcher.task.Context().Done():
|
||||||
|
return
|
||||||
|
default:
|
||||||
dispatcher.logCh <- msg
|
dispatcher.logCh <- msg
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
func (disp *Dispatcher) RegisterProvider(cfg types.NotificationConfig) (Provider, E.Error) {
|
func (disp *Dispatcher) RegisterProvider(cfg types.NotificationConfig) (Provider, E.Error) {
|
||||||
providerName, ok := cfg["provider"]
|
providerName, ok := cfg["provider"]
|
||||||
|
|
Loading…
Add table
Reference in a new issue