From b13fa228b618f1e176173b802aa3c85f03efbdf7 Mon Sep 17 00:00:00 2001 From: Dmitry Verkhoturov Date: Tue, 25 May 2021 13:53:44 +0200 Subject: [PATCH] start using the provided timeout in the telegram notify --- backend/app/notify/telegram.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/app/notify/telegram.go b/backend/app/notify/telegram.go index ac184a8b0a..6f48031b32 100644 --- a/backend/app/notify/telegram.go +++ b/backend/app/notify/telegram.go @@ -46,7 +46,7 @@ func NewTelegram(token, channelID string, timeout time.Duration, api string) (*T defer cancel() err := repeater.NewDefault(5, time.Millisecond*250).Do(ctx, func() error { - client := http.Client{Timeout: telegramTimeOut} + client := http.Client{Timeout: res.timeout} resp, err := client.Get(fmt.Sprintf("%s%s/getMe", res.apiPrefix, token)) if err != nil { return errors.Wrap(err, "can't initialize telegram notifications") @@ -86,7 +86,7 @@ func NewTelegram(token, channelID string, timeout time.Duration, api string) (*T // Send to telegram channel func (t *Telegram) Send(ctx context.Context, req Request) error { - client := http.Client{Timeout: telegramTimeOut} + client := http.Client{Timeout: t.timeout} log.Printf("[DEBUG] send telegram notification to %s, comment id %s", t.channelID, req.Comment.ID) from := req.Comment.User.Name