From 9f7e236ecdb1a6dcd153c46d26ad9380a4c59e53 Mon Sep 17 00:00:00 2001 From: shoopea Date: Sat, 4 May 2019 17:01:57 +0800 Subject: [PATCH] upd --- main.go | 9 +++++++-- mq.go | 1 + 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 95ef728..cfa1535 100644 --- a/main.go +++ b/main.go @@ -51,7 +51,8 @@ var ( db *sql.DB - cfg Config + cfg Config + MQCWMsgQueue chan ChatWarsMessage ) func PrintText(m *tb.Message) { @@ -94,7 +95,11 @@ func main() { } go StartBot() - go MQMainReceive() + + MQCWMsgQueue = make(chan ChatWarsMessage, 100) + for w := 1; w <= 3; w++ { + go MQGetMsg(w, MQCWMsgQueue) + } fmt.Println("Started !") diff --git a/mq.go b/mq.go index 2de4ea2..379fd20 100644 --- a/mq.go +++ b/mq.go @@ -3,6 +3,7 @@ package main import ( "encoding/json" "log" + "strconv" "github.com/streadway/amqp" )