parent
c2a12b880e
commit
afa8b181ae
19
workers.go
19
workers.go
@ -62,7 +62,6 @@ func MQGetMsgWorker(id int, msgs chan<- ChatWarsMessage) {
|
|||||||
msgs <- x
|
msgs <- x
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Printf("MQGetMsgWorker[" + strconv.Itoa(id) + "] : Closing queue.\n")
|
|
||||||
s.Close()
|
s.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -92,7 +91,6 @@ func MQKeepAliveWorker() {
|
|||||||
log.Printf("MQKeepAliveWorker : Session address : %p.\n", &s)
|
log.Printf("MQKeepAliveWorker : Session address : %p.\n", &s)
|
||||||
log.Printf("MQKeepAliveWorker : Connection address : %p.\n", &s.MQConnection)
|
log.Printf("MQKeepAliveWorker : Connection address : %p.\n", &s.MQConnection)
|
||||||
log.Printf("MQKeepAliveWorker : Channel address : %p.\n", &s.MQChannel)
|
log.Printf("MQKeepAliveWorker : Channel address : %p.\n", &s.MQChannel)
|
||||||
/*
|
|
||||||
q, err := s.MQChannel.QueueDeclare(
|
q, err := s.MQChannel.QueueDeclare(
|
||||||
s.Queue, // name
|
s.Queue, // name
|
||||||
false, // durable
|
false, // durable
|
||||||
@ -111,8 +109,6 @@ func MQKeepAliveWorker() {
|
|||||||
false, // no-wait
|
false, // no-wait
|
||||||
nil, // args
|
nil, // args
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
for d := range m {
|
for d := range m {
|
||||||
log.Printf("MQKeepAliveWorker : Received a message: %s", string(d.Body))
|
log.Printf("MQKeepAliveWorker : Received a message: %s", string(d.Body))
|
||||||
x := MQKeepAlive{}
|
x := MQKeepAlive{}
|
||||||
@ -153,13 +149,18 @@ func MQKeepAliveWorker() {
|
|||||||
TGCmdQueue <- c
|
TGCmdQueue <- c
|
||||||
|
|
||||||
clientSendCWMsg(x.UserID64, `🏅Me`)
|
clientSendCWMsg(x.UserID64, `🏅Me`)
|
||||||
clientSendCWMsg(x.UserID64, `/hero`)
|
/*
|
||||||
}
|
c = TGCommand{
|
||||||
}
|
Type: commandSendMsg,
|
||||||
|
FromUserID64: x.UserID64,
|
||||||
|
ToChatID64: userID64ChtWrsBot,
|
||||||
|
Text: `/hero`,
|
||||||
}
|
}
|
||||||
|
MQTGCmdQueue <- c
|
||||||
*/
|
*/
|
||||||
s.Close()
|
}
|
||||||
log.Printf("MQKeepAliveWorker : Closing queue.\n")
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
log.Printf("MQKeepAliveWorker : Closing.")
|
log.Printf("MQKeepAliveWorker : Closing.")
|
||||||
|
Loading…
Reference in New Issue
Block a user