This repository was archived by the owner on Feb 5, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +7
-5
lines changed
Expand file tree Collapse file tree 4 files changed +7
-5
lines changed Original file line number Diff line number Diff line change 22 "network-configs" : {
33 "test-network" : {
44 "name" : " Test Network" ,
5- "profile" : " ./connection-profile/test-network-ca .json"
5+ "profile" : " ./connection-profile/test-network.json"
66 }
77 },
88 "license" : " Apache-2.0"
Original file line number Diff line number Diff line change @@ -56,6 +56,7 @@ export class FabricGateway {
5656 this . asLocalhost = false ;
5757 this . ds = null ;
5858 this . dsTargets = [ ] ;
59+ this . waitingResp = false ;
5960 }
6061
6162 async initialize ( ) {
@@ -432,6 +433,7 @@ export class FabricGateway {
432433 try {
433434 if ( ! this . waitingResp ) {
434435 this . waitingResp = true ;
436+ logger . info ( 'Sending discovery request...' ) ;
435437 await this . ds . send ( {
436438 asLocalhost : this . asLocalhost ,
437439 requestTimeout : 5000 ,
@@ -441,18 +443,18 @@ export class FabricGateway {
441443 logger . info ( 'Succeeded to send discovery request' ) ;
442444 } else {
443445 logger . info ( 'Have already been sending a request' ) ;
446+ return null ;
444447 }
445448
446449 result = await this . ds . getDiscoveryResults ( true ) ;
450+ this . waitingResp = false ;
447451 } catch ( error ) {
448452 logger . warn ( 'Failed to send discovery request for channel' , error ) ;
449453 if ( this . ds ) {
450454 this . ds . close ( ) ;
451455 this . ds = null ;
452456 }
453457 result = null ;
454- } finally {
455- this . waitingResp = false ;
456458 }
457459 return result ;
458460 }
Original file line number Diff line number Diff line change @@ -67,7 +67,7 @@ function getFabricGatewayInstance() {
6767 const config = new FabricConfig ( ) ;
6868 config . initialize ( 'first-network' , {
6969 name : 'My first network' ,
70- profile : './connection-profile/first -network.json'
70+ profile : './connection-profile/test -network.json'
7171 } ) ;
7272 sinon . stub ( config , 'getPeerTlsCACertsPem' ) ;
7373
Original file line number Diff line number Diff line change @@ -52,7 +52,7 @@ function getSyncServicesInstance() {
5252 const config = new FabricConfig ( ) ;
5353 config . initialize ( 'first-network' , {
5454 name : 'My first network' ,
55- profile : './connection-profile/first -network.json'
55+ profile : './connection-profile/test -network.json'
5656 } ) ;
5757 sinon . stub ( config , 'getPeerTlsCACertsPem' ) ;
5858 const stubGetCrudService = sinon . stub ( ) ;
You can’t perform that action at this time.
0 commit comments