[ Cmii ] [ Octopus ] - hot fix manual shut down init queue
This commit is contained in:
@@ -46,6 +46,8 @@ type RabbitQueue struct {
|
||||
RabbitConnectInfo *RabbitTCPConnectInfo
|
||||
// 返回消息队列
|
||||
ReceiveChan *RabbitReceiveChan
|
||||
// Consume 是否继续
|
||||
ConsumeOK bool
|
||||
}
|
||||
|
||||
// RabbitMQConn is a struct that holds the connection and channel objects
|
||||
@@ -192,6 +194,7 @@ func (r *RabbitQueue) Close() error {
|
||||
func (r *RabbitQueue) Handle() chan bool {
|
||||
|
||||
deliveries := r.Read(true)
|
||||
|
||||
foreverHandle := make(chan bool)
|
||||
// 死循环,处理Octopus Message
|
||||
P.Submit(func() {
|
||||
@@ -208,6 +211,13 @@ func (r *RabbitQueue) Handle() chan bool {
|
||||
P.Submit(func() {
|
||||
om.HandleMsg(r.ReceiveChan)
|
||||
})
|
||||
|
||||
// 2024年4月9日
|
||||
if !r.ConsumeOK {
|
||||
marshal, _ := json.Marshal(r.RabbitProp)
|
||||
log.InfoF("Rabbit Queue of %s disconnect!", marshal)
|
||||
break
|
||||
}
|
||||
}
|
||||
})
|
||||
return foreverHandle
|
||||
|
||||
Reference in New Issue
Block a user