mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-01-20 22:42:53 -05:00
Merge pull request #2880 from halfdan/2879-socket-issue
Fix error when running Ghost with a socket
This commit is contained in:
commit
b7aca05d95
1 changed files with 10 additions and 7 deletions
|
@ -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*/
|
||||
httpServer = server.listen(
|
||||
config.getSocket()
|
||||
);
|
||||
fs.chmod(config.getSocket(), '0660');
|
||||
});
|
||||
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…
Add table
Reference in a new issue