add timer for timeout

This commit is contained in:
shoopea 2019-05-06 11:19:58 +08:00
parent 4d510021e5
commit bac80e723f

1
td.go
View File

@ -89,6 +89,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
if err.Error() == "timeout" { if err.Error() == "timeout" {
logOnError(err, "Waiting...") logOnError(err, "Waiting...")
fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339)) 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 { } else {
logOnError(err, "Cannot get history") logOnError(err, "Cannot get history")
lastParsedID64 = -1 lastParsedID64 = -1