1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-07-03 11:53:41 +02:00

cmd/thalos/main.go: Make telegram notifications optional

This commit is contained in:
Henrik Hautakoski 2023-07-18 10:20:55 +02:00
parent b04a03ae87
commit e1dc5f85a0

View file

@ -225,17 +225,20 @@ func main() {
} }
// Init telegram notification service // Init telegram notification service
telegram, err := telegram.New(conf.Telegram.Id) if len(conf.Telegram.Id) > 0 {
if err != nil {
log.WithError(err).Fatal("Failed to initialize telegram") telegram, err := telegram.New(conf.Telegram.Id)
return if err != nil {
log.WithError(err).Fatal("Failed to initialize telegram")
return
}
telegram.AddReceivers(conf.Telegram.Channel)
// Register services in notification manager
notify.UseServices(telegram)
} }
telegram.AddReceivers(conf.Telegram.Channel)
// Register services in notification manager
notify.UseServices(telegram)
// Connect to redis // Connect to redis
rdb := redis.NewClient(&redis.Options{ rdb := redis.NewClient(&redis.Options{
Addr: conf.Redis.Addr, Addr: conf.Redis.Addr,