summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Mehren2021-03-29 23:01:32 +0200
committerGitHub2021-03-29 23:01:32 +0200
commit74f3780b220d2240f1f0e06875080d3c3ea3ed1d (patch)
tree85a073b0145e80319156bc21fbe395a40c8abeaf
parent6531ea1a2144804677f6832646f18117b1e555a2 (diff)
parent6501e62557155ef9068637dd5b9009b7f99fe7a5 (diff)
Merge pull request #1083 from hedgedoc/fix/unix_socket_cleanup
Properly clean up socket on exit
-rw-r--r--app.js8
1 files changed, 7 insertions, 1 deletions
diff --git a/app.js b/app.js
index ce37032b..51b5f093 100644
--- a/app.js
+++ b/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()) {