Skip to content

Commit

Permalink
Merge e1f4c5a into c90ea28
Browse files Browse the repository at this point in the history
  • Loading branch information
Ferlonas committed Jun 25, 2020
2 parents c90ea28 + e1f4c5a commit 4f2610d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .travis.yml
Expand Up @@ -10,4 +10,5 @@ go:
- 1.14.x

script:
- make test
- docker-compose run testserver make ci
6 changes: 5 additions & 1 deletion backend/queue/rmq.go
Expand Up @@ -16,7 +16,10 @@ var (
queueHealthLimits sync.Map
)

func init() {
func initDefault() {
if rmqConnection != nil {
return
}
rmqConnection = rmq.OpenConnectionWithRedisClient("default", redis.Client())
gatherMetrics(rmqConnection)
servicehealthcheck.RegisterHealthCheck("rmq", &HealthCheck{})
Expand All @@ -28,6 +31,7 @@ func init() {
// If the queue has already been opened, it will just be returned. Limits will not
// be updated
func NewQueue(name string, healthyLimit int) rmq.Queue {
initDefault()
queue := rmqConnection.OpenQueue(name)
if _, ok := queueHealthLimits.Load(name); ok {
return queue
Expand Down

0 comments on commit 4f2610d

Please sign in to comment.