From 98d81c2f2f575db7be99b82ff5606be221705551 Mon Sep 17 00:00:00 2001 From: Mike Gerwitz Date: Thu, 21 Mar 2019 16:34:41 -0400 Subject: [PATCH] RatingServicePublish: Close connections after a timeout Until we have a better option. I really hate that all of this is rushed. --- src/server/service/RatingServicePublish.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/server/service/RatingServicePublish.js b/src/server/service/RatingServicePublish.js index fa0ac14..a99944f 100644 --- a/src/server/service/RatingServicePublish.js +++ b/src/server/service/RatingServicePublish.js @@ -95,10 +95,12 @@ module.exports = Trait( 'RatingServicePublish' ) { const queue = this._conf.queueName; - let connection = null; - this._amqp.connect( this._conf ) - .then( conn => connection = conn.createChannel() ) + .then( conn => + { + setTimeout( () => conn.close(), 10000 ); + return conn.createChannel(); + } ) .then( ch => { ch.assertQueue( queue, { durable: true } );