channel err logging
This commit is contained in:
parent
8c1a705a6a
commit
ec22bcd3ad
|
@ -245,7 +245,7 @@ func BuildHandler(w http.ResponseWriter, r *http.Request) {
|
|||
wsChannel := session.OutputWS[sid]
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
||||
wsChannel.Refresh()
|
||||
|
|
|
@ -94,7 +94,7 @@ func GoGetHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ func GoGetHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
||||
wsChannel.Refresh()
|
||||
|
|
|
@ -188,7 +188,7 @@ func GoInstallHandler(w http.ResponseWriter, r *http.Request) {
|
|||
wsChannel := session.OutputWS[sid]
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
||||
wsChannel.Refresh()
|
||||
|
|
|
@ -98,7 +98,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -125,7 +125,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
channelRet["output"] = ""
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -146,7 +146,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
r, _, err := outReader.ReadRune()
|
||||
|
||||
if nil != err {
|
||||
// remove the exited process from user process set
|
||||
// remove the exited process from user's process set
|
||||
Processes.Remove(wSession, cmd.Process)
|
||||
|
||||
logger.Debugf("User [%s, %s] 's running [id=%d, file=%s] has done [stdout %v], ", wSession.Username, sid, runningId, filePath, err)
|
||||
|
@ -155,7 +155,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
channelRet["output"] = buf.content
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -184,7 +184,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err = wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -222,7 +222,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err = wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ func GoTestHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ func GoTestHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
||||
wsChannel.Refresh()
|
||||
|
|
|
@ -95,7 +95,7 @@ func GoVetHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -140,7 +140,7 @@ func GoVetHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
||||
wsChannel.Refresh()
|
||||
|
|
|
@ -96,7 +96,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -123,7 +123,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
channelRet["output"] = ""
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -153,7 +153,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
channelRet["output"] = buf.content
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -182,7 +182,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err = wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
break
|
||||
}
|
||||
|
||||
|
@ -220,7 +220,7 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err = wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
break
|
||||
}
|
||||
|
||||
|
|
|
@ -95,7 +95,7 @@ func CloneHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -132,7 +132,7 @@ func CloneHandler(w http.ResponseWriter, r *http.Request) {
|
|||
|
||||
err := wsChannel.WriteJSON(&channelRet)
|
||||
if nil != err {
|
||||
logger.Error(err)
|
||||
logger.Warn(err)
|
||||
}
|
||||
|
||||
wsChannel.Refresh()
|
||||
|
|
Loading…
Reference in New Issue