This commit is contained in:
shoopea 2019-05-04 11:56:03 +08:00
parent 6545c2d1e9
commit 098f729a95
3 changed files with 2 additions and 4 deletions

View File

@ -4,7 +4,6 @@ import (
"flag" "flag"
"fmt" "fmt"
"log" "log"
"time"
"gopkg.in/gcfg.v1" "gopkg.in/gcfg.v1"

3
mq.go
View File

@ -3,11 +3,12 @@ package main
import ( import (
"encoding/json" "encoding/json"
"log" "log"
"strconv"
"github.com/streadway/amqp" "github.com/streadway/amqp"
) )
func MQSendMsgWorker(id int, msgs chan<- ChatWarsMessage) { func MQSendMsgWorker(id int, msgs <-chan ChatWarsMessage) {
var x ChatWarsMessage var x ChatWarsMessage
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.Queue)
failOnError(err, "MQSendMsgWorker["+strconv.Itoa(id)+"] : Failed to connect to RabbitMQ") failOnError(err, "MQSendMsgWorker["+strconv.Itoa(id)+"] : Failed to connect to RabbitMQ")

2
td.go
View File

@ -1,14 +1,12 @@
package main package main
import ( import (
"encoding/json"
"fmt" "fmt"
"log" "log"
"math" "math"
"time" "time"
"github.com/Arman92/go-tdlib" "github.com/Arman92/go-tdlib"
"github.com/streadway/amqp"
) )
func ListenCW(c *tdlib.Client) { func ListenCW(c *tdlib.Client) {