File tree Expand file tree Collapse file tree 1 file changed +14
-10
lines changed
Expand file tree Collapse file tree 1 file changed +14
-10
lines changed Original file line number Diff line number Diff line change @@ -346,18 +346,22 @@ export class RedisQueue extends EventEmitter<EventMap>
346346 if ( this . subscription ) {
347347 this . verbose ( 'Initialize unsubscribing...' ) ;
348348
349- if ( this . subscriptionName ) {
350- this . subscription . unsubscribe (
351- `${ this . options . prefix } :${ this . subscriptionName } ` ,
352- ) ;
349+ try {
350+ if ( this . subscriptionName ) {
351+ await this . subscription . unsubscribe (
352+ `${ this . options . prefix } :${ this . subscriptionName } ` ,
353+ ) ;
353354
354- this . verbose ( `Unsubscribed from ${
355- this . subscriptionName } channel`) ;
356- }
355+ this . verbose ( `Unsubscribed from ${
356+ this . subscriptionName } channel`) ;
357+ }
357358
358- this . subscription . removeAllListeners ( ) ;
359- this . subscription . disconnect ( false ) ;
360- this . subscription . quit ( ) ;
359+ this . subscription . removeAllListeners ( ) ;
360+ this . subscription . quit ( ) ;
361+ this . subscription . disconnect ( false ) ;
362+ } catch ( error ) {
363+ this . verbose ( `Unsubscribe error: ${ error } ` ) ;
364+ }
361365 }
362366
363367 this . subscriptionName = undefined ;
You can’t perform that action at this time.
0 commit comments