mirror of
https://github.com/zadam/trilium.git
synced 2025-03-11 14:33:29 +08:00
Exit on SIGINT
Pressing Ctrl+C used to not exit the application (at least when running the Docker image). Explicitly catching the `SIGINT` interrupt signal and exiting fixes the problem. We currently make it exit immediately as soon as the signal arrives. In the future, it may be preferable to do dispatch some event and try to exit more gracefully (finish any ongoing synchronization work, etc.) Still, I think it's better to exit directly than to not do anything at all, in which case `SIGKILL` is likely to follow and kill the process even more abruptly.
This commit is contained in:
parent
873b60b00d
commit
86b9f5a8b0
1 changed files with 5 additions and 0 deletions
5
src/www
5
src/www
|
@ -8,6 +8,11 @@ process.on('unhandledRejection', error => {
|
|||
require('./services/log').info(error);
|
||||
});
|
||||
|
||||
process.on('SIGINT', function() {
|
||||
console.log("Caught interrupt signal. Exiting.");
|
||||
process.exit();
|
||||
});
|
||||
|
||||
const { app, sessionParser } = require('./app');
|
||||
const debug = require('debug')('node:server');
|
||||
const fs = require('fs');
|
||||
|
|
Loading…
Reference in a new issue