From 29972a9e8f9b635e64ba1e0cd1eeb00d8bcc0c08 Mon Sep 17 00:00:00 2001 From: shoopea Date: Thu, 16 May 2019 10:52:30 +0800 Subject: [PATCH] test --- job.go | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) diff --git a/job.go b/job.go index 977e2b1..a38888c 100644 --- a/job.go +++ b/job.go @@ -29,8 +29,8 @@ func jobRescan(j Job) { } p := JobPayloadSetDone{ JobID64: j.ID64, - MsgID64: j.MsgID64, - ChatID64: j.ChatID64, + MsgID64: r.MsgID64, + ChatID64: r.ChatID64, Text: fmt.Sprintf("%d messages processed.", len(ids)), } b, _ := json.Marshal(p) @@ -41,20 +41,20 @@ func jobRescan(j Job) { err = setJobDone(j.ID64) logOnError(err, "jobRescan : setJobDone(1)") m := TGCommand{ - Type: commandReplyMsg, - Text: "One message processed.", - FromMsgID64: j.MsgID64, - FromChatID64j.ChatID64, + Type: commandReplyMsg, + Text: "One message processed.", + FromMsgID64: j.MsgID64, + FromChatID64: r.ChatID64, } TGCmdQueue <- m } else { err = setJobDone(j.ID64) logOnError(err, "jobRescan : setJobDone(0)") m := TGCommand{ - Type: commandReplyMsg, - Text: "No message processed.", - FromMsgID64: j.MsgID64, - FromChatID64j.ChatID64, + Type: commandReplyMsg, + Text: "No message processed.", + FromMsgID64: r.MsgID64, + FromChatID64: r.ChatID64, } TGCmdQueue <- m } @@ -76,5 +76,13 @@ func jobSetDone(j Job) { err = setJobDone(j.ID64) logOnError(err, "jobSetDone : setJobDone") + m := TGCommand{ + Type: commandReplyMsg, + Text: r.Text, + FromMsgID64: r.MsgID64, + FromChatID64: r.ChatID64, + } + TGCmdQueue <- m + return }