mirror of
https://github.com/statbate/special-pancake.git
synced 2026-08-11 03:12:42 +00:00
fix deadlock if server deadlock
This commit is contained in:
parent
a5646a39f6
commit
fbbe4921c9
1 changed files with 5 additions and 5 deletions
10
app/main.go
10
app/main.go
|
|
@ -55,9 +55,9 @@ func main() {
|
|||
go saveLogs()
|
||||
go socketHandler()
|
||||
|
||||
http.HandleFunc("/cmd/", cmdHandler)
|
||||
http.HandleFunc("/list/", listHandler)
|
||||
http.HandleFunc("/debug/", debugHandler)
|
||||
http.HandleFunc("/chaturbate/cmd/", cmdHandler)
|
||||
http.HandleFunc("/chaturbate/list/", listHandler)
|
||||
http.HandleFunc("/chaturbate/debug/", debugHandler)
|
||||
|
||||
go fastStart()
|
||||
|
||||
|
|
@ -99,8 +99,8 @@ func socketHandler() {
|
|||
select {
|
||||
case b := <-socketServer:
|
||||
|
||||
if conn == nil {
|
||||
conn, err = net.Dial("unix", "/tmp/echo.sock")
|
||||
if conn == nil || conn.RemoteAddr() == nil {
|
||||
conn, err = net.DialTimeout("unix", "/tmp/echo.sock", time.Second*5)
|
||||
if err != nil {
|
||||
fmt.Println(err.Error())
|
||||
continue
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue