Skip to content
New issue

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

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

Already on GitHub? # to your account

chore: fixes restart without indy pool disconnect #2137

Merged
Changes from 1 commit
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
12 changes: 11 additions & 1 deletion packages/indy-vdr/src/pool/IndyVdrPool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface IndyVdrPoolConfig {

export class IndyVdrPool {
private _pool?: indyVdrPool
private _archievedPool?: indyVdrPool
private poolConfig: IndyVdrPoolConfig
public authorAgreement?: AuthorAgreement | null

Expand All @@ -61,6 +62,12 @@ export class IndyVdrPool {
throw new IndyVdrError('Cannot connect to pool, already connected.')
GHkrishna marked this conversation as resolved.
Show resolved Hide resolved
}

if (this._archievedPool) {
this._pool = this._archievedPool
this._archievedPool = undefined
return
}

this._pool = new PoolCreate({
parameters: {
transactions: this.config.genesisTransactions,
Expand Down Expand Up @@ -96,8 +103,11 @@ export class IndyVdrPool {
throw new IndyVdrError("Can't close pool. Pool is not connected")
}

// FIXME: this method doesn't work??
// FIXME: Currently, the close method is not working coorectly in the indy-vdr-shared package
// this.pool.close()
// Hence, a workaround to reset the _pool
this._archievedPool = this._pool
this._pool = undefined
}

public async prepareWriteRequest<Request extends IndyVdrRequest>(
Expand Down
Loading