1
0
Fork 0
mirror of https://github.com/eosswedenorg/thalos synced 2026-06-16 04:24:56 +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
telegram, err := telegram.New(conf.Telegram.Id)
if err != nil {
log.WithError(err).Fatal("Failed to initialize telegram")
return
if len(conf.Telegram.Id) > 0 {
telegram, err := telegram.New(conf.Telegram.Id)
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
rdb := redis.NewClient(&redis.Options{
Addr: conf.Redis.Addr,