From eda764b192b52a6c6bd7bda2058dc286f5869fc39909ef4971b7cb9925c50a04 Mon Sep 17 00:00:00 2001 From: Adam Majer Date: Thu, 18 Jul 2024 12:01:35 +0200 Subject: [PATCH] . --- obs-staging-bot/rabbitmq.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/obs-staging-bot/rabbitmq.go b/obs-staging-bot/rabbitmq.go index 578c069..7942e9d 100644 --- a/obs-staging-bot/rabbitmq.go +++ b/obs-staging-bot/rabbitmq.go @@ -61,6 +61,7 @@ func startProcessingObsMessages(host, username, password string) { if len(username) > 0 && len(password) > 0 { auth = username + ":" + password + "@" } + connection, err := rabbitmq.DialTLS("amqps://"+auth+host, &tls.Config{ ServerName: host, }) @@ -74,7 +75,12 @@ func startProcessingObsMessages(host, username, password string) { err = ch.ExchangeDeclarePassive("pubsub", "topic", true, false, false, false, nil) failOnError(err, "Cannot find pubsub exchange") - q, err := ch.QueueDeclare("", false, true, false, false, nil) + q, err := ch.QueueDeclarePassive("obs-staging-bot", true, false, true, false, nil) + if err != nil { + log.Printf("queue not found .. trying to create it\n") + q, err = ch.QueueDeclare("obs-staging-bot", true, false, true, false, nil) + } + //q, err := ch.QueueDeclare("obs-staging-bot", false, true, false, false, nil) failOnError(err, "Cannot declare queue") log.Printf("queue: %s:%d", q.Name, q.Consumers)