mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 06:35:49 +03:00
Fix error when running Ghost with a socket
fixes #2879 - Syncronously unlink old socket file
This commit is contained in:
parent
1ae98df995
commit
f9369459db
@ -261,13 +261,16 @@ function init(server) {
|
||||
// ## Start Ghost App
|
||||
if (config.getSocket()) {
|
||||
// Make sure the socket is gone before trying to create another
|
||||
fs.unlink(config.getSocket(), function (err) {
|
||||
/*jshint unused:false*/
|
||||
try {
|
||||
fs.unlinkSync(config.getSocket());
|
||||
} catch (e) {
|
||||
// We can ignore this.
|
||||
}
|
||||
|
||||
httpServer = server.listen(
|
||||
config.getSocket()
|
||||
);
|
||||
fs.chmod(config.getSocket(), '0660');
|
||||
});
|
||||
|
||||
} else {
|
||||
httpServer = server.listen(
|
||||
|
Loading…
Reference in New Issue
Block a user