mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 20:22:53 +00:00
Merge pull request #1642 from michaelarnauts/patch-2
Handle SIGTERM messages
This commit is contained in:
commit
834ab5c6b9
@ -19,6 +19,7 @@ This project adheres to [Semantic Versioning](http://semver.org/).
|
||||
### Updated
|
||||
|
||||
### Fixed
|
||||
- Handle SIGTERM messages
|
||||
|
||||
## [2.7.1] - 2019-04-02
|
||||
|
||||
|
@ -263,6 +263,15 @@ var App = function() {
|
||||
this.stop();
|
||||
process.exit(0);
|
||||
});
|
||||
|
||||
/* We also need to listen to SIGTERM signals so we stop everything when we are asked to stop by the OS.
|
||||
*/
|
||||
process.on("SIGTERM", () => {
|
||||
console.log("[SIGTERM] Received. Shutting down server...");
|
||||
setTimeout(() => { process.exit(0); }, 3000); // Force quit after 3 seconds
|
||||
this.stop();
|
||||
process.exit(0);
|
||||
});
|
||||
};
|
||||
|
||||
module.exports = new App();
|
||||
|
Loading…
x
Reference in New Issue
Block a user