mirror of
https://github.com/engineer-man/piston.git
synced 2025-04-20 20:16:26 +02:00
Improve containers stopping performance by handling SIGTERM
This commit is contained in:
parent
b9adb6f854
commit
fef00b96f1
4 changed files with 32 additions and 6 deletions
|
@ -35,7 +35,10 @@ expressWs(app);
|
|||
}
|
||||
}
|
||||
});
|
||||
fss.chmodSync(path.join(config.data_directory, globals.data_directories.jobs), 0o711)
|
||||
fss.chmodSync(
|
||||
path.join(config.data_directory, globals.data_directories.jobs),
|
||||
0o711
|
||||
);
|
||||
|
||||
logger.info('Loading packages');
|
||||
const pkgdir = path.join(
|
||||
|
@ -92,7 +95,12 @@ expressWs(app);
|
|||
logger.debug('Calling app.listen');
|
||||
const [address, port] = config.bind_address.split(':');
|
||||
|
||||
app.listen(port, address, () => {
|
||||
const server = app.listen(port, address, () => {
|
||||
logger.info('API server started on', config.bind_address);
|
||||
});
|
||||
|
||||
process.on('SIGTERM', () => {
|
||||
server.close();
|
||||
process.exit(0)
|
||||
});
|
||||
})();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue