test
This commit is contained in:
parent
4728679b7d
commit
2a98b7e548
19
workers.go
19
workers.go
@ -13,7 +13,8 @@ import (
|
||||
tb "gopkg.in/tucnak/telebot.v2"
|
||||
)
|
||||
|
||||
func (c *MQClient) Open() error {
|
||||
func Open(c *MQClient) error {
|
||||
log.Printf("Open : Address of struct : %p\n", c)
|
||||
var err error
|
||||
c.Connection, err = amqp.Dial("amqp://" + c.User + ":" + c.Password + "@" + c.Host + "/" + c.Path)
|
||||
|
||||
@ -36,14 +37,16 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
|
||||
//log.Printf("MQGetMsgWorker[" + strconv.Itoa(id) + "] : Starting.")
|
||||
var x ChatWarsMessage
|
||||
for true {
|
||||
c := new(MQClient)
|
||||
c.User = cfg.Rabbit.User
|
||||
c.Password = cfg.Rabbit.Password
|
||||
c.Host = cfg.Rabbit.Host
|
||||
c.Path = cfg.Rabbit.Path
|
||||
c.SSL = false
|
||||
c := MQClient{
|
||||
User: cfg.Rabbit.User,
|
||||
Password: cfg.Rabbit.Password,
|
||||
Host: cfg.Rabbit.Host,
|
||||
Path: cfg.Rabbit.Path,
|
||||
SSL: false,
|
||||
}
|
||||
|
||||
err := c.Open()
|
||||
log.Printf("MQGetMsgWorker["+strconv.Itoa(id)+"] : Address of struct : %p\n", c)
|
||||
err := c.Open(c)
|
||||
|
||||
if err != nil {
|
||||
q, err := c.Channel.QueueDeclare(
|
||||
|
Loading…
Reference in New Issue
Block a user