1
0
Fork 0

RatingServicePublish: Close connections after a timeout

Until we have a better option.

I really hate that all of this is rushed.
master
Mike Gerwitz 2019-03-21 16:34:41 -04:00
parent c4591f681d
commit 98d81c2f2f
1 changed files with 5 additions and 3 deletions

View File

@ -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 } );