This commit is contained in:
Liang Ding 2014-09-16 15:11:14 +08:00
parent 07f38fd483
commit 75ee2b9c89
3 changed files with 18 additions and 0 deletions

View File

@ -61,6 +61,7 @@ func event2Notification(e *event.Event) {
wsChannel.Conn.WriteJSON(&notification)
// 更新通道最近使用时间
wsChannel.Time = time.Now()
}
@ -106,5 +107,7 @@ func WSHandler(w http.ResponseWriter, r *http.Request) {
glog.Error("Notification WS ERROR: " + err.Error())
return
}
wsChan.Time = time.Now()
}
}

View File

@ -110,6 +110,9 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
glog.Error(err)
break
}
// 更新通道最近使用时间
wsChannel.Time = time.Now()
}
}
}
@ -264,6 +267,9 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
if nil != err {
glog.Error(err)
}
// 更新通道最近使用时间
wsChannel.Time = time.Now()
}
}(rand.Int())
@ -386,6 +392,9 @@ func GoInstallHandler(w http.ResponseWriter, r *http.Request) {
if nil != err {
glog.Error(err)
}
// 更新通道最近使用时间
wsChannel.Time = time.Now()
}
}(rand.Int())
@ -465,6 +474,9 @@ func GoGetHandler(w http.ResponseWriter, r *http.Request) {
glog.Error(err)
break
}
// 更新通道最近使用时间
wsChannel.Time = time.Now()
}
}
}

View File

@ -117,6 +117,9 @@ func WSHandler(w http.ResponseWriter, r *http.Request) {
glog.Error("Shell WS ERROR: " + err.Error())
return
}
// 更新通道最近使用时间
wsChan.Time = time.Now()
}
}