Skip to content

Commit

Permalink
fix(indy): async ledger connection issues on iOS (#803)
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick Kenyon <[email protected]>
  • Loading branch information
TheTreek authored Jun 13, 2022
1 parent 16b316c commit 8055652
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions packages/core/src/modules/ledger/services/IndyPoolService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,15 @@ export class IndyPoolService {
* Create connections to all ledger pools
*/
public async connectToPools() {
const poolsPromises = this.pools.map((pool) => {
return pool.connect()
})
return Promise.all(poolsPromises)
const handleArray: number[] = []
// Sequentially connect to pools so we don't use up too many resources connecting in parallel
for (const pool of this.pools) {
this.logger.debug(`Connecting to pool: ${pool.id}`)
const poolHandle = await pool.connect()
this.logger.debug(`Finished connection to pool: ${pool.id}`)
handleArray.push(poolHandle)
}
return handleArray
}

/**
Expand Down

0 comments on commit 8055652

Please sign in to comment.