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:
parent
b04a03ae87
commit
e1dc5f85a0
1 changed files with 12 additions and 9 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue