From ae70c7091a831777e7695e730626ca6a9d93a56b Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 11 May 2019 17:13:29 +0800 Subject: [PATCH] test --- td.go | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/td.go b/td.go index 1cb8714..e98b8d9 100644 --- a/td.go +++ b/td.go @@ -101,8 +101,8 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { msgs, err := c.GetChatHistory(chat, lastParsedID64, 0, 33, false) if err != nil { if err.Error() == "timeout" { - logOnError(err, "Waiting...") - fmt.Printf("Timeout : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) + logOnError(err, "Waiting....") + fmt.Printf("Timeout : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) time.Sleep(5 * time.Second) } else { logOnError(err, "Cannot get history") @@ -153,7 +153,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { lastParsedTime = m.Date } if msgParsed%1000 == 0 { - fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) + fmt.Printf("Waiting : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) } } @@ -166,6 +166,8 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) { // we should be at the end ! lastParsedID64 = -1 } else { + logOnError(err, "Overflow ...") + fmt.Printf("Overflow : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64) time.Sleep(5 * time.Second) } }