Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(indy): async ledger connection issues on iOS #803

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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