mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-09 13:51:57 -04:00
Properly clean up socket on exit
`file.unlink` requires a callback, which we didn't set. This commit adds a callback with (error) logging, enabling HedgeDoc to properly clean up the socket. Closes #784 Signed-off-by: David Mehren <git@herrmehren.de>
This commit is contained in:
parent
6531ea1a21
commit
6501e62557
1 changed files with 7 additions and 1 deletions
8
app.js
8
app.js
|
@ -301,7 +301,13 @@ function handleTermSignals () {
|
|||
}, 0)
|
||||
})
|
||||
if (config.path) {
|
||||
fs.unlink(config.path)
|
||||
fs.unlink(config.path, err => {
|
||||
if (err) {
|
||||
logger.error(`Could not cleanup socket: ${err.message}`)
|
||||
} else {
|
||||
logger.info('Successfully cleaned up socket')
|
||||
}
|
||||
})
|
||||
}
|
||||
const checkCleanTimer = setInterval(function () {
|
||||
if (realtime.isReady()) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue