File tree Expand file tree Collapse file tree 1 file changed +9
-10
lines changed
Expand file tree Collapse file tree 1 file changed +9
-10
lines changed Original file line number Diff line number Diff line change @@ -112,13 +112,10 @@ export class RedisClient {
112112 } ) ( ) ;
113113
114114 // Listen for socket close events and parse responses.
115- this . #connection. then ( async ( connection ) => {
116- try {
115+ this . #connection
116+ . then ( async ( connection ) => {
117117 while ( true ) {
118- const result = await Promise . race ( [
119- connection . socket . closed ,
120- connection . reader . read ( ) ,
121- ] ) ;
118+ const result = await connection . reader . read ( ) ;
122119 if ( ! result ) {
123120 break ;
124121 }
@@ -129,10 +126,12 @@ export class RedisClient {
129126 break ;
130127 }
131128 }
132- } finally {
133- await this . close ( ) ;
134- }
135- } ) ;
129+ } )
130+ . catch ( ( error ) => {
131+ if ( error ) {
132+ console . error ( error ) ;
133+ }
134+ } ) ;
136135
137136 if ( this . config . password || this . config . database ) {
138137 // AUTH and SELECT block all other commands until they are resolved.
You can’t perform that action at this time.
0 commit comments