mirror of
https://github.com/appium/appium.git
synced 2026-05-06 10:59:35 -05:00
Merge pull request #7015 from KrugerHeavyIndustries/graceful_exit
graceful handling of SIGTERM and SIGINT such that return codes are mo…
This commit is contained in:
+11
@@ -132,6 +132,17 @@ async function main (args = null) {
|
||||
await server.close();
|
||||
throw err;
|
||||
}
|
||||
|
||||
process.on('SIGINT', async function () {
|
||||
logger.info(`Received SIGINT - shutting down`);
|
||||
await server.close();
|
||||
});
|
||||
|
||||
process.on('SIGTERM', async function () {
|
||||
logger.info(`Received SIGTERM - shutting down`);
|
||||
await server.close();
|
||||
});
|
||||
|
||||
logServerPort(args.address, args.port);
|
||||
|
||||
return server;
|
||||
|
||||
Reference in New Issue
Block a user