Skip to content

Commit 539a9f1

Browse files
committed
Prefer process.once in examples
1 parent f9c44f8 commit 539a9f1

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed

examples/calltimeout.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -88,11 +88,11 @@ async function run() {
8888
}
8989

9090
process
91-
.on('SIGTERM', function() {
91+
.once('SIGTERM', function() {
9292
console.log("\nTerminating");
9393
process.exit(0);
9494
})
95-
.on('SIGINT', function() {
95+
.once('SIGINT', function() {
9696
console.log("\nTerminating");
9797
process.exit(0);
9898
});

examples/cqn1.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ async function runTest() {
149149
}
150150

151151
process
152-
.on('SIGTERM', function() {
152+
.once('SIGTERM', function() {
153153
console.log("\nTerminating");
154154
process.exit(0);
155155
})
156-
.on('SIGINT', function() {
156+
.once('SIGINT', function() {
157157
console.log("\nTerminating");
158158
process.exit(0);
159159
});

examples/cqn2.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,11 +149,11 @@ async function runTest() {
149149
}
150150

151151
process
152-
.on('SIGTERM', function() {
152+
.once('SIGTERM', function() {
153153
console.log("\nTerminating");
154154
process.exit(0);
155155
})
156-
.on('SIGINT', function() {
156+
.once('SIGINT', function() {
157157
console.log("\nTerminating");
158158
process.exit(0);
159159
});

examples/endtoend.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,11 +83,11 @@ async function run() {
8383
}
8484

8585
process
86-
.on('SIGTERM', function() {
86+
.once('SIGTERM', function() {
8787
console.log("\nTerminating");
8888
process.exit(0);
8989
})
90-
.on('SIGINT', function() {
90+
.once('SIGINT', function() {
9191
console.log("\nTerminating");
9292
process.exit(0);
9393
});

0 commit comments

Comments
 (0)