From bf859eff6241b68b24af368f35c8549a0847b374 Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Fri, 27 Dec 2024 19:52:41 +0530 Subject: [PATCH 1/2] chore: fixes #2135 agent restart without pool disconnect Signed-off-by: Krishna Waske --- packages/indy-vdr/src/pool/IndyVdrPool.ts | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/indy-vdr/src/pool/IndyVdrPool.ts b/packages/indy-vdr/src/pool/IndyVdrPool.ts index e2d3a8c57e..17de8df670 100644 --- a/packages/indy-vdr/src/pool/IndyVdrPool.ts +++ b/packages/indy-vdr/src/pool/IndyVdrPool.ts @@ -41,6 +41,7 @@ export interface IndyVdrPoolConfig { export class IndyVdrPool { private _pool?: indyVdrPool + private _archievedPool?: indyVdrPool private poolConfig: IndyVdrPoolConfig public authorAgreement?: AuthorAgreement | null @@ -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, @@ -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( From 8b5bfa2f2e73f40239547aa67008e965766cd9bd Mon Sep 17 00:00:00 2001 From: Krishna Waske Date: Tue, 31 Dec 2024 11:01:44 +0530 Subject: [PATCH 2/2] chore: remove unnecessary archieving of pool Signed-off-by: Krishna Waske --- packages/indy-vdr/src/pool/IndyVdrPool.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/indy-vdr/src/pool/IndyVdrPool.ts b/packages/indy-vdr/src/pool/IndyVdrPool.ts index 17de8df670..c2292d9975 100644 --- a/packages/indy-vdr/src/pool/IndyVdrPool.ts +++ b/packages/indy-vdr/src/pool/IndyVdrPool.ts @@ -41,7 +41,6 @@ export interface IndyVdrPoolConfig { export class IndyVdrPool { private _pool?: indyVdrPool - private _archievedPool?: indyVdrPool private poolConfig: IndyVdrPoolConfig public authorAgreement?: AuthorAgreement | null @@ -59,12 +58,6 @@ export class IndyVdrPool { public connect() { if (this._pool) { - throw new IndyVdrError('Cannot connect to pool, already connected.') - } - - if (this._archievedPool) { - this._pool = this._archievedPool - this._archievedPool = undefined return } @@ -103,11 +96,8 @@ export class IndyVdrPool { throw new IndyVdrError("Can't close pool. Pool is not connected") } - // FIXME: Currently, the close method is not working coorectly in the indy-vdr-shared package + // FIXME: Currently, the close method is not working correctly 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(