Exit on SIGTERM (#1891)

Stopping the systemd service running the server now works properly.
This commit is contained in:
FliegendeWurst 2021-04-25 11:05:09 +02:00 committed by GitHub
parent b9133cb683
commit 6f49f870ed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

11
src/www
View File

@ -8,10 +8,13 @@ process.on('unhandledRejection', error => {
require('./services/log').info(error);
});
process.on('SIGINT', function() {
console.log("Caught interrupt signal. Exiting.");
process.exit();
});
function exit() {
console.log("Caught interrupt/termination signal. Exiting.");
process.exit(0);
}
process.on('SIGINT', exit);
process.on('SIGTERM', exit);
const { app, sessionParser } = require('./app');
const fs = require('fs');