From 9287915b39f057ad7d865acb3cf395a4699f37b4 Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 3 May 2019 18:31:57 +0800 Subject: [PATCH] debug --- td.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/td.go b/td.go index dade51e..d32f1e1 100644 --- a/td.go +++ b/td.go @@ -109,6 +109,7 @@ func ListenCW(c *tdlib.Client) { func getHistory(c *tdlib.Client) { var lastMsgID64 int64 = int64(math.MaxInt64) + var msgCount int32 = 0 conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Queue) if err != nil { @@ -169,12 +170,14 @@ func getHistory(c *tdlib.Client) { if msg.ID < lastMsgID64 { lastMsgID64 = msg.ID } + msgCount = msgCount + 1 default: log.Printf("getHistory : no handler for %s\n", msg.Content) } } } } + log.Printf("Exported %d messages.\n", msgCount) } func ForwardMsg(c *tdlib.Client, msgID int64, fromChatID int64, toChatID int64) int64 {