f96a6285 by astaxie

fix #978

1 parent e938876c
Showing 1 changed file with 7 additions and 0 deletions
...@@ -19,7 +19,10 @@ import ( ...@@ -19,7 +19,10 @@ import (
19 "net" 19 "net"
20 "net/http" 20 "net/http"
21 "net/http/fcgi" 21 "net/http/fcgi"
22 "os"
22 "time" 23 "time"
24
25 "github.com/astaxie/beego/utils"
23 ) 26 )
24 27
25 // App defines beego application with a new PatternServeMux. 28 // App defines beego application with a new PatternServeMux.
...@@ -59,6 +62,10 @@ func (app *App) Run() { ...@@ -59,6 +62,10 @@ func (app *App) Run() {
59 } 62 }
60 } else { 63 } else {
61 if HttpPort == 0 { 64 if HttpPort == 0 {
65 // remove the Socket file before start
66 if utils.FileExists(addr) {
67 os.Remove(addr)
68 }
62 l, err = net.Listen("unix", addr) 69 l, err = net.Listen("unix", addr)
63 } else { 70 } else {
64 l, err = net.Listen("tcp", addr) 71 l, err = net.Listen("tcp", addr)
......
Styling with Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!