Skip to content

Commit

Permalink
chore: fixes #2135 agent restart without pool disconnect
Browse files Browse the repository at this point in the history
Signed-off-by: Krishna Waske <[email protected]>
  • Loading branch information
GHkrishna committed Dec 27, 2024
1 parent 14673b1 commit bf859ef
Showing 1 changed file with 11 additions and 1 deletion.
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.')
}

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

0 comments on commit bf859ef

Please sign in to comment.