Merge pull request #1083 from hedgedoc/fix/unix_socket_cleanup

Properly clean up socket on exit
This commit is contained in:
David Mehren 2021-03-29 23:01:32 +02:00 committed by GitHub
commit 74f3780b22
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

8
app.js
View file

@ -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()) {