Skip to content

Commit d5cb100

Browse files
committed
Add sig handlers. Remove parallelism to make queue stats easier to understand
1 parent 9e06797 commit d5cb100

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

examples/webapp.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved. */
1+
/* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. */
22

33
/******************************************************************************
44
*
@@ -88,7 +88,7 @@ oracledb.createPool (
8888
// console.log("Connections in use: " + pool.connectionsInUse);
8989

9090
connection.execute(
91-
"SELECT employee_id, first_name, last_name " +
91+
"SELECT employee_id, first_name, last_name " +
9292
"FROM employees " +
9393
"WHERE department_id = :id",
9494
[deptid], // bind variable value
@@ -115,11 +115,11 @@ oracledb.createPool (
115115
{
116116
if (err) {
117117
handleError(response, "normal release() callback", err);
118-
return;
118+
} else {
119+
htmlFooter(response);
119120
}
120121
});
121122

122-
htmlFooter(response);
123123
});
124124
});
125125
});
@@ -193,3 +193,13 @@ function htmlFooter(response)
193193
response.write("</body>\n</html>");
194194
response.end();
195195
}
196+
197+
process
198+
.on('SIGTERM', function() {
199+
console.log("\nTerminating");
200+
process.exit(0);
201+
})
202+
.on('SIGINT', function() {
203+
console.log("\nTerminating");
204+
process.exit(0);
205+
});

0 commit comments

Comments
 (0)