File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed
Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -126,13 +126,18 @@ class Subscriber extends events.EventEmitter {
126126 function removeListeners ( ) {
127127 subscription . removeListener ( 'message' , onMessage ) ;
128128 subscription . removeListener ( 'error' , onError ) ;
129- process . removeListener ( 'SIGTERM' , deleteSubscription ) ;
130- process . removeListener ( 'SIGINT' , deleteSubscription ) ;
129+
130+ if ( ! this . disableFanOut ) {
131+ process . removeListener ( 'SIGTERM' , deleteSubscription ) ;
132+ process . removeListener ( 'SIGINT' , deleteSubscription ) ;
133+ }
131134 }
132135
133136 // Handle termination, delete the subscription (require graceful shutdowm)
134- process . on ( 'SIGTERM' , deleteSubscription ) ;
135- process . on ( 'SIGINT' , deleteSubscription ) ;
137+ if ( ! this . disableFanOut ) {
138+ process . on ( 'SIGTERM' , deleteSubscription ) ;
139+ process . on ( 'SIGINT' , deleteSubscription ) ;
140+ }
136141
137142 // Bind the subscription
138143 subscription . on ( 'message' , onMessage ) ;
You can’t perform that action at this time.
0 commit comments