Skip to content

Commit

Permalink
fix: connection close not awaited
Browse files Browse the repository at this point in the history
The AmqpConnectionManager close promise was resolved before the
underlying connection was fully closed.
  • Loading branch information
luddd3 committed Aug 23, 2021
1 parent 69f1da3 commit 8955fe7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/AmqpConnectionManager.js
Expand Up @@ -101,8 +101,12 @@ export default class AmqpConnectionManager extends EventEmitter {
this._channels = [];
if (this._currentConnection) {
this._currentConnection.removeAllListeners('close');
this._currentConnection.close();
return this._currentConnection.close();
} else {
return null;
}
})
.then(() => {
this._currentConnection = null;
});
});
Expand Down

0 comments on commit 8955fe7

Please sign in to comment.