From bac80e723f80bc976d48d646d356eac86fbd4f7a Mon Sep 17 00:00:00 2001 From: shoopea Date: Mon, 6 May 2019 11:19:58 +0800 Subject: [PATCH] add timer for timeout --- td.go | 1 + 1 file changed, 1 insertion(+) diff --git a/td.go b/td.go index 31d7cf2..60bfff9 100644 --- a/td.go +++ b/td.go @@ -89,6 +89,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { if err.Error() == "timeout" { logOnError(err, "Waiting...") fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339)) + time.Sleep(5 * time.Second) } else { logOnError(err, "Cannot get history") lastParsedID64 = -1