test
This commit is contained in:
parent
7997a82986
commit
c928aa323a
2
def.go
2
def.go
@ -45,4 +45,6 @@ const (
|
|||||||
cmdParseModePlain = 1
|
cmdParseModePlain = 1
|
||||||
cmdParseModeMarkDown = 2
|
cmdParseModeMarkDown = 2
|
||||||
cmdParseModeHTML = 3
|
cmdParseModeHTML = 3
|
||||||
|
|
||||||
|
KeepAliveHeartBeatSeconds = 5
|
||||||
)
|
)
|
||||||
|
3
mq.go
3
mq.go
@ -86,7 +86,6 @@ func MQReceiveMsgWorker(id int, cmd chan<- TGCommand) {
|
|||||||
err = json.Unmarshal(d.Body, &c)
|
err = json.Unmarshal(d.Body, &c)
|
||||||
logOnError(err, "MQReceiveMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))
|
logOnError(err, "MQReceiveMsgWorker["+strconv.Itoa(id)+"] : Can't unmarshal.\n"+string(d.Body))
|
||||||
if err == nil {
|
if err == nil {
|
||||||
log.Printf("****************************** New MQ message ******************************\n%s\n****************************************************************************\n", string(d.Body))
|
|
||||||
cmd <- c
|
cmd <- c
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -139,7 +138,7 @@ func MQKeepAliveWorker() {
|
|||||||
logOnError(err, "MQKeepAliveWorker : Publishing message.")
|
logOnError(err, "MQKeepAliveWorker : Publishing message.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
time.Sleep(time.Minute)
|
time.Sleep(KeepAliveHeartBeatSeconds * time.Second)
|
||||||
}
|
}
|
||||||
log.Printf("MQKeepAliveWorker : Closing.")
|
log.Printf("MQKeepAliveWorker : Closing.")
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user