File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -103,10 +103,11 @@ export function createAdapter(
103103 let isConnectionInProgress = false ;
104104 let client : PoolClient | undefined ;
105105 let cleanupTimer : NodeJS . Timeout ;
106+ let reconnectTimer : NodeJS . Timeout ;
106107
107108 const scheduleReconnection = ( ) => {
108109 const reconnectionDelay = Math . floor ( 2000 * ( 0.5 + Math . random ( ) ) ) ;
109- setTimeout ( initClient , reconnectionDelay ) ;
110+ reconnectTimer = setTimeout ( initClient , reconnectionDelay ) ;
110111 } ;
111112
112113 const initClient = async ( ) => {
@@ -184,9 +185,8 @@ export function createAdapter(
184185 client . release ( ) ;
185186 client = undefined ;
186187 }
187- if ( cleanupTimer ) {
188- clearTimeout ( cleanupTimer ) ;
189- }
188+ clearTimeout ( reconnectTimer ) ;
189+ clearTimeout ( cleanupTimer ) ;
190190 }
191191
192192 defaultClose . call ( adapter ) ;
You can’t perform that action at this time.
0 commit comments