diff --git a/backend/queue/rmq.go b/backend/queue/rmq.go index fd817ac8..9007ebc8 100644 --- a/backend/queue/rmq.go +++ b/backend/queue/rmq.go @@ -14,12 +14,18 @@ import ( var ( rmqConnection rmq.Connection queueHealthLimits sync.Map + + initMutex sync.Mutex ) func initDefault() { + initMutex.Lock() + defer initMutex.Unlock() + if rmqConnection != nil { return } + rmqConnection = rmq.OpenConnectionWithRedisClient("default", redis.Client()) gatherMetrics(rmqConnection) servicehealthcheck.RegisterHealthCheck("rmq", &HealthCheck{})