Add process.exit(0) to sample applications

Add process.exit(0) so that sample javascript and typescript
applications exit with success upon completion instead of hanging.

Signed-off-by: David Enyeart <enyeart@us.ibm.com>
This commit is contained in:
David Enyeart 2021-06-16 16:21:59 -04:00
parent 1cd71fd26a
commit 3160f91569
19 changed files with 20 additions and 2 deletions

View file

@ -175,6 +175,7 @@ async function main() {
} catch (error) {
console.error(`******** FAILED to run the application: ${error}`);
}
process.exit(0);
}
main();

View file

@ -166,6 +166,7 @@ async function main() {
} catch (error) {
console.error(`******** FAILED to run the application: ${error}`);
}
process.exit(0);
}
main();

View file

@ -238,7 +238,7 @@ async function main() {
}
console.log('*** application ending');
process.exit(0);
}
main();

View file

@ -353,6 +353,7 @@ async function main() {
}
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -344,6 +344,7 @@ async function main() {
}
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -563,5 +563,6 @@ async function main() {
process.exit(1);
}
console.log(`${GREEN} **** END ****${RESET}`);
process.exit(0);
}
main();

View file

@ -88,6 +88,7 @@ async function main () {
// Disconnect from the gateway
console.log('Disconnect from Fabric gateway.');
gateway.disconnect();
process.exit(0);
}
}

View file

@ -138,6 +138,7 @@ async function main() {
// Disconnect from the gateway
console.log('Disconnect from Fabric gateway.');
gateway.disconnect();
process.exit(0);
}
}

View file

@ -89,6 +89,7 @@ async function main() {
// Disconnect from the gateway
console.log('Disconnect from Fabric gateway.')
gateway.disconnect();
process.exit(0);
}
}

View file

@ -86,6 +86,7 @@ async function main() {
// Disconnect from the gateway
console.log('Disconnect from Fabric gateway.');
gateway.disconnect();
process.exit(0);
}
}

View file

@ -86,6 +86,7 @@ async function main() {
// Disconnect from the gateway
console.log('Disconnect from Fabric gateway.');
gateway.disconnect();
process.exit(0);
}
}

View file

@ -51,6 +51,7 @@ async function main() {
console.error(`Failed to enroll admin user "admin": ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -52,6 +52,7 @@ async function main() {
console.error(`Failed to submit transaction: ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -48,11 +48,12 @@ async function main() {
// Disconnect from the gateway.
await gateway.disconnect();
} catch (error) {
console.error(`Failed to evaluate transaction: ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -70,6 +70,7 @@ async function main() {
console.error(`Failed to register user "appUser": ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -47,6 +47,7 @@ async function main() {
console.error(`Failed to enroll admin user "admin": ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -48,6 +48,7 @@ async function main() {
console.error(`Failed to submit transaction: ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -46,6 +46,7 @@ async function main() {
console.error(`Failed to evaluate transaction: ${error}`);
process.exit(1);
}
process.exit(0);
}
main();

View file

@ -59,6 +59,7 @@ async function main() {
console.error(`Failed to register user "appUser": ${error}`);
process.exit(1);
}
process.exit(0);
}
main();