Skip to content
This repository has been archived by the owner on Feb 26, 2023. It is now read-only.

Commit

Permalink
Add default timeout variable
Browse files Browse the repository at this point in the history
Reduce it to 20 seconds
  • Loading branch information
ilyaglow committed Nov 27, 2018
1 parent d6f5ca2 commit 67c214a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion run.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,15 @@ import (
"github.com/go-telegram-bot-api/telegram-bot-api"
)

const defaultTimeout = 20

// Run represents infinite function that waits for a message,
// authenticate user and process task
func (c *Client) Run() {
defer c.DB.Close()

u := tgbotapi.NewUpdate(0)
u.Timeout = 60
u.Timeout = defaultTimeout

updates, err := c.Bot.GetUpdatesChan(u)
if err != nil {
Expand Down

0 comments on commit 67c214a

Please sign in to comment.