Skip to content

Commit

Permalink
start using the provided timeout in the telegram notify
Browse files Browse the repository at this point in the history
  • Loading branch information
paskal authored and umputun committed May 25, 2021
1 parent 8d8c6ee commit b13fa22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions backend/app/notify/telegram.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b13fa22

Please sign in to comment.