Skip to content

Commit c910cdf

Browse files
committed
fixed arguments in pool method
1 parent 87f887a commit c910cdf

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/connection_pool.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export class ConnectionPool {
2525
return cachedConnection
2626
} else {
2727
const newConnection = await connectionCreator()
28-
this.cacheConnection(this.connectionsMap, key, newConnection)
28+
this.cacheConnection(key, newConnection)
2929
return newConnection
3030
}
3131
}
@@ -38,10 +38,10 @@ export class ConnectionPool {
3838
}
3939
}
4040

41-
private cacheConnection(map: Map<InstanceKey, Connection[]>, key: string, connection: Connection) {
42-
const currentlyCached = map.get(key) || []
41+
private cacheConnection(key: string, connection: Connection) {
42+
const currentlyCached = this.connectionsMap.get(key) || []
4343
currentlyCached.push(connection)
44-
map.set(key, currentlyCached)
44+
this.connectionsMap.set(key, currentlyCached)
4545
}
4646

4747
private removeCachedConnection(connection: Connection) {

0 commit comments

Comments
 (0)