mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-29 04:29:41 +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
|
### Updated
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
- Handle SIGTERM messages
|
||||||
|
|
||||||
## [2.7.1] - 2019-04-02
|
## [2.7.1] - 2019-04-02
|
||||||
|
|
||||||
|
@ -263,6 +263,15 @@ var App = function() {
|
|||||||
this.stop();
|
this.stop();
|
||||||
process.exit(0);
|
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();
|
module.exports = new App();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user