This commit is contained in:
shoopea 2019-06-28 15:59:58 +08:00
parent 4f4d10d2d7
commit 8cf2b41560
2 changed files with 3 additions and 3 deletions

View File

@ -14,7 +14,7 @@ database = chirpnest
user = chirpnest
password = chirpnest
host = localhost:5672
queue = chirpnest
path = chirpnest
[bot]
admin = 0

View File

@ -17,7 +17,7 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
//log.Printf("MQGetMsgWorker[" + strconv.Itoa(id) + "] : Starting.")
var x ChatWarsMessage
for true {
conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Queue)
conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Path)
logOnError(err, "MQGetMsgWorker["+strconv.Itoa(id)+"] : Failed to connect to RabbitMQ")
if err != nil {
conn.Close()
@ -369,7 +369,7 @@ func MQTGCmdWorker(id int, cmds <-chan TGCommand) {
func MQKeepAliveWorker() {
//log.Printf("MQKeepAliveWorker : Starting.")
for true {
conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Queue)
conn, err := amqp.Dial("amqp://" + cfg.Rabbit.User + ":" + cfg.Rabbit.Password + "@" + cfg.Rabbit.Host + "/" + cfg.Rabbit.Path)
logOnError(err, "MQKeepAliveWorker : Failed to connect to RabbitMQ")
if err != nil {
conn.Close()