File tree Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Expand file tree Collapse file tree 1 file changed +3
-0
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,7 @@ module.exports = class Amqp extends Component.mixin(AsyncEmitter) {
12
12
this . logger = logger ;
13
13
this . _connection ;
14
14
this . _initializing = false ;
15
+ this . _isShuttingDown = false ;
15
16
this . serviceSub = null ;
16
17
this . serviceSubQueue = null ;
17
18
this . signals = [ "SIGINT" , "SIGTERM" , "SIGQUIT" ] ;
@@ -27,6 +28,7 @@ module.exports = class Amqp extends Component.mixin(AsyncEmitter) {
27
28
28
29
* doConnect ( ) {
29
30
if ( this . _initializing ) return ;
31
+ if ( this . _isShuttingDown ) return ;
30
32
this . _initializing = true ;
31
33
let {
32
34
secure,
@@ -82,6 +84,7 @@ module.exports = class Amqp extends Component.mixin(AsyncEmitter) {
82
84
83
85
* stop ( ) {
84
86
try {
87
+ this . _isShuttingDown = true ;
85
88
this . logger . info ( "Shutting down rabbitmq plugin..." ) ;
86
89
this . _connection . close ( ) ;
87
90
} catch ( e ) {
You can’t perform that action at this time.
0 commit comments