mirror of
https://github.com/hcengineering/platform.git
synced 2025-06-09 09:20:54 +00:00
One more fix
Signed-off-by: Denis Bykhov <bykhov.denis@gmail.com>
This commit is contained in:
parent
57e74375c5
commit
f0ee6485de
@ -139,12 +139,12 @@ class ConnectionInfo {
|
||||
readonly managed: boolean
|
||||
) {}
|
||||
|
||||
async withReserve (action: (reservedClient: DBClient) => Promise<any>): Promise<any> {
|
||||
async withReserve (action: (reservedClient: DBClient) => Promise<any>, forced: boolean = false): Promise<any> {
|
||||
let reserved: DBClient | undefined
|
||||
|
||||
// Check if we have at least one available connection and reserve one more if required.
|
||||
if (this.available.length === 0) {
|
||||
if (this.managed) {
|
||||
if (this.managed || forced) {
|
||||
reserved = await this.client.reserve()
|
||||
}
|
||||
} else {
|
||||
@ -219,7 +219,7 @@ class ConnectionMgr {
|
||||
return false
|
||||
}
|
||||
}
|
||||
})
|
||||
}, true)
|
||||
if (retry === true) {
|
||||
break
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user