fix
This commit is contained in:
@@ -13,7 +13,12 @@ type QueueItem struct {
|
||||
Queue amqp.Queue
|
||||
}
|
||||
|
||||
func InitRabbitMq(url string, config *tls.Config) map[string]*QueueItem {
|
||||
var mapMq = make(map[string]*QueueItem)
|
||||
|
||||
func InitRabbitMq(url string, config *tls.Config) {
|
||||
if url == "" {
|
||||
return
|
||||
}
|
||||
conn, err := amqp.DialTLS(url, config)
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to connect to RabbitMQ: %v", err)
|
||||
@@ -23,7 +28,6 @@ func InitRabbitMq(url string, config *tls.Config) map[string]*QueueItem {
|
||||
if err != nil {
|
||||
log.Fatalf("Failed to open a channel: %v", err)
|
||||
}
|
||||
mapMq := make(map[string]*QueueItem)
|
||||
//声明队列
|
||||
for _, queueName := range constants.MQ_QUEUE_ARR {
|
||||
q, err := ch.QueueDeclare(
|
||||
@@ -44,5 +48,4 @@ func InitRabbitMq(url string, config *tls.Config) map[string]*QueueItem {
|
||||
Queue: q,
|
||||
}
|
||||
}
|
||||
return mapMq
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user