RatingServicePublish: Close connections after a timeout
Until we have a better option. I really hate that all of this is rushed.master
parent
c4591f681d
commit
98d81c2f2f
|
@ -95,10 +95,12 @@ module.exports = Trait( 'RatingServicePublish' )
|
||||||
{
|
{
|
||||||
const queue = this._conf.queueName;
|
const queue = this._conf.queueName;
|
||||||
|
|
||||||
let connection = null;
|
|
||||||
|
|
||||||
this._amqp.connect( this._conf )
|
this._amqp.connect( this._conf )
|
||||||
.then( conn => connection = conn.createChannel() )
|
.then( conn =>
|
||||||
|
{
|
||||||
|
setTimeout( () => conn.close(), 10000 );
|
||||||
|
return conn.createChannel();
|
||||||
|
} )
|
||||||
.then( ch => {
|
.then( ch => {
|
||||||
ch.assertQueue( queue, { durable: true } );
|
ch.assertQueue( queue, { durable: true } );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue