From c928aa323a29e4cd3187bbeef970b05d4e4b5d89 Mon Sep 17 00:00:00 2001 From: shoopea Date: Fri, 14 Jun 2019 11:32:42 +0800 Subject: [PATCH] test --- def.go | 2 ++ mq.go | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/def.go b/def.go index bf82122..f9c568e 100644 --- a/def.go +++ b/def.go @@ -45,4 +45,6 @@ const ( cmdParseModePlain = 1 cmdParseModeMarkDown = 2 cmdParseModeHTML = 3 + + KeepAliveHeartBeatSeconds = 5 ) diff --git a/mq.go b/mq.go index 716bd21..5ea4b7a 100644 --- a/mq.go +++ b/mq.go @@ -86,7 +86,6 @@ func MQReceiveMsgWorker(id int, cmd chan<- TGCommand) { err = json.Unmarshal(d.Body, &c) logOnError(err, "MQReceiveMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body)) if err == nil { - log.Printf("****************************** New MQ message ******************************\n%s\n****************************************************************************\n", string(d.Body)) cmd <- c } } @@ -139,7 +138,7 @@ func MQKeepAliveWorker() { logOnError(err, "MQKeepAliveWorker : Publishing message.") } } - time.Sleep(time.Minute) + time.Sleep(KeepAliveHeartBeatSeconds * time.Second) } log.Printf("MQKeepAliveWorker : Closing.") }