From 762d189cc85711a8a718fe24647065ee54e362a7 Mon Sep 17 00:00:00 2001 From: Orne Brocaar Date: Tue, 19 Oct 2021 14:45:15 +0100 Subject: [PATCH] Restore the AMQP queue if needed after a connection failure. Closes #503. --- internal/backend/gateway/amqp/amqp.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/internal/backend/gateway/amqp/amqp.go b/internal/backend/gateway/amqp/amqp.go index 3ffdd62a..bf090d64 100644 --- a/internal/backend/gateway/amqp/amqp.go +++ b/internal/backend/gateway/amqp/amqp.go @@ -277,6 +277,11 @@ func (b *Backend) eventLoop() { // (in the loop). log.WithError(err).Error("gateway/amqp: event loop error") time.Sleep(time.Second) + + // Restore the queue if needed. + if err := b.setupQueue(); err != nil { + log.WithError(err).Error("gateway/amqp: setup queue error") + } } } }