From 75ee2b9c891f7c5cb14b458367538237c706d36e Mon Sep 17 00:00:00 2001 From: Liang Ding Date: Tue, 16 Sep 2014 15:11:14 +0800 Subject: [PATCH] . --- notification/notifications.go | 3 +++ output/outputs.go | 12 ++++++++++++ shell/shells.go | 3 +++ 3 files changed, 18 insertions(+) diff --git a/notification/notifications.go b/notification/notifications.go index 26874d7..fb74bd0 100644 --- a/notification/notifications.go +++ b/notification/notifications.go @@ -61,6 +61,7 @@ func event2Notification(e *event.Event) { wsChannel.Conn.WriteJSON(¬ification) + // 更新通道最近使用时间 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() } } diff --git a/output/outputs.go b/output/outputs.go index bdc187e..1ff1c69 100644 --- a/output/outputs.go +++ b/output/outputs.go @@ -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() } } } diff --git a/shell/shells.go b/shell/shells.go index 2baed54..f7199bd 100644 --- a/shell/shells.go +++ b/shell/shells.go @@ -117,6 +117,9 @@ func WSHandler(w http.ResponseWriter, r *http.Request) { glog.Error("Shell WS ERROR: " + err.Error()) return } + + // 更新通道最近使用时间 + wsChan.Time = time.Now() } }