Skip to content

Commit

Permalink
-v20190628
Browse files Browse the repository at this point in the history
  • Loading branch information
dwg65535 committed Jun 28, 2019
1 parent 9739385 commit a952cdf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions main/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ func main() {
}
}

func init() {
func init() { //生成pid文件,保存pid
pidFileName := "pid"
fileInfo, err := os.Stat(pidFileName)
if err != nil {
Expand All @@ -54,7 +54,7 @@ func init() {
logs.Error("open pidFile [%s] error :%v", pidFileName, err)
return
}
err = pidFile.Truncate(0)
err = pidFile.Truncate(0) //清空数据

_, err = io.WriteString(pidFile, strconv.Itoa(pid))
if err != nil {
Expand Down
8 changes: 4 additions & 4 deletions static/js/net.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,11 @@ PG.Socket.connect = function(onopen, onmessage, onerror) {
return;
}

if (localStorage.hasOwnProperty("port")){
this.websocket = new WebSocket("ws://" + window.location.host +":" + localStorage.getItem("port") + "/ws");
} else {
// if (localStorage.hasOwnProperty("port")){
// this.websocket = new WebSocket("ws://" + window.location.host +":" + localStorage.getItem("port") + "/ws");
// } else {
this.websocket = new WebSocket("ws://" + window.location.host + "/ws");
}
// }

this.websocket.binaryType = 'arraybuffer';
this.websocket.onopen = function(evt) {
Expand Down

0 comments on commit a952cdf

Please sign in to comment.