mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-24 14:43:08 +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
|
// ## Start Ghost App
|
||||||
if (config.getSocket()) {
|
if (config.getSocket()) {
|
||||||
// Make sure the socket is gone before trying to create another
|
// Make sure the socket is gone before trying to create another
|
||||||
fs.unlink(config.getSocket(), function (err) {
|
try {
|
||||||
/*jshint unused:false*/
|
fs.unlinkSync(config.getSocket());
|
||||||
|
} catch (e) {
|
||||||
|
// We can ignore this.
|
||||||
|
}
|
||||||
|
|
||||||
httpServer = server.listen(
|
httpServer = server.listen(
|
||||||
config.getSocket()
|
config.getSocket()
|
||||||
);
|
);
|
||||||
fs.chmod(config.getSocket(), '0660');
|
fs.chmod(config.getSocket(), '0660');
|
||||||
});
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
httpServer = server.listen(
|
httpServer = server.listen(
|
||||||
|
Loading…
Reference in New Issue
Block a user