File tree Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Expand file tree Collapse file tree 2 files changed +12
-6
lines changed Original file line number Diff line number Diff line change @@ -147,9 +147,11 @@ export class RedisPubSub implements PubSubEngine {
147
147
return this . redisPublisher ;
148
148
}
149
149
150
- public close ( ) : void {
151
- this . redisPublisher . quit ( ) ;
152
- this . redisSubscriber . quit ( ) ;
150
+ public close ( ) : Promise < any > {
151
+ return Promise . all ( [
152
+ this . redisPublisher . quit ( ) ,
153
+ this . redisSubscriber . quit ( ) ,
154
+ ] ) ;
153
155
}
154
156
155
157
private onMessage ( pattern : string , channel : string , message : string ) {
Original file line number Diff line number Diff line change @@ -53,9 +53,13 @@ describe('RedisPubSub', () => {
53
53
54
54
it ( 'should verify close calls pub and sub quit methods' , done => {
55
55
const pubSub = new RedisPubSub ( mockOptions ) ;
56
- pubSub . close ( ) ;
57
- expect ( quitSpy . callCount ) . to . equal ( 2 ) ;
58
- done ( ) ;
56
+
57
+ pubSub . close ( )
58
+ . then ( ( ) => {
59
+ expect ( quitSpy . callCount ) . to . equal ( 2 ) ;
60
+ done ( ) ;
61
+ } )
62
+ . catch ( done ) ;
59
63
} ) ;
60
64
61
65
it ( 'can subscribe to specific redis channel and called when a message is published on it' , done => {
You can’t perform that action at this time.
0 commit comments