Merge pull request #297 from tony1223/bug/261-default-notification

fix #261 provide default config for notification setting
This commit is contained in:
Yo-An Lin 2021-12-05 01:17:04 +08:00 committed by GitHub
commit 9d38dc2c87

View File

@ -616,6 +616,15 @@ func (environ *Environment) ConfigureNotificationSystem(userConfig *Config) erro
environ.Notifiability.AddNotifier(notifier)
}
if userConfig.Notifications == nil {
userConfig.Notifications = &NotificationConfig{
Routing : &SlackNotificationRouting{
Trade: "$session",
Order: "$session",
},
}
}
if userConfig.Notifications != nil {
if err := environ.ConfigureNotificationRouting(userConfig.Notifications); err != nil {
return err