mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-28 05:37:34 +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());
|
||||||
httpServer = server.listen(
|
} catch (e) {
|
||||||
config.getSocket()
|
// We can ignore this.
|
||||||
);
|
}
|
||||||
fs.chmod(config.getSocket(), '0660');
|
|
||||||
});
|
httpServer = server.listen(
|
||||||
|
config.getSocket()
|
||||||
|
);
|
||||||
|
fs.chmod(config.getSocket(), '0660');
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
httpServer = server.listen(
|
httpServer = server.listen(
|
||||||
|
Loading…
Reference in New Issue
Block a user