[#1243] node/cfg: Add notification config

Signed-off-by: Pavel Karpy <carpawell@nspcc.ru>
This commit is contained in:
Pavel Karpy 2022-03-15 22:42:15 +03:00 committed by Alex Vanin
parent 16543a1904
commit 5dba64fcc5
3 changed files with 19 additions and 5 deletions

View file

@ -131,6 +131,15 @@ func initNotifications(c *cfg) {
panic("could not created object notificator: " + err.Error())
}
c.cfgNotifications = cfgNotifications{
enabled: true,
nw: notificationWriter{
l: c.log,
w: natsSvc,
},
defaultTopic: topic,
}
n := notificator.New(new(notificator.Prm).
SetLogger(c.log).
SetNotificationSource(
@ -139,10 +148,7 @@ func initNotifications(c *cfg) {
l: c.log,
defaultTopic: topic,
}).
SetWriter(notificationWriter{
l: c.log,
w: natsSvc,
}),
SetWriter(c.cfgNotifications.nw),
)
addNewEpochAsyncNotificationHandler(c, func(e event.Event) {