test
This commit is contained in:
parent
23f4120d71
commit
ae70c7091a
8
td.go
8
td.go
@ -101,8 +101,8 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
|
|||||||
msgs, err := c.GetChatHistory(chat, lastParsedID64, 0, 33, false)
|
msgs, err := c.GetChatHistory(chat, lastParsedID64, 0, 33, false)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
if err.Error() == "timeout" {
|
if err.Error() == "timeout" {
|
||||||
logOnError(err, "Waiting...")
|
logOnError(err, "Waiting....")
|
||||||
fmt.Printf("Timeout : %d messages retrieved out of %d dating back %s (%d) ...\n", msgCount, msgParsed, lastParsedTime.Format(time.RFC3339), lastParsedID64)
|
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)
|
time.Sleep(5 * time.Second)
|
||||||
} else {
|
} else {
|
||||||
logOnError(err, "Cannot get history")
|
logOnError(err, "Cannot get history")
|
||||||
@ -153,7 +153,7 @@ func getHistory(c *tdlib.Client, chatID64 *int64, senderUserID64 *int64) {
|
|||||||
lastParsedTime = m.Date
|
lastParsedTime = m.Date
|
||||||
}
|
}
|
||||||
if msgParsed%1000 == 0 {
|
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 !
|
// we should be at the end !
|
||||||
lastParsedID64 = -1
|
lastParsedID64 = -1
|
||||||
} else {
|
} 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)
|
time.Sleep(5 * time.Second)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user