This commit is contained in:
Liang Ding 2019-05-16 18:12:38 +08:00
parent 7deb7c60e5
commit c24e4f4711
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
1 changed files with 4 additions and 14 deletions

View File

@ -80,22 +80,12 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
}
wsChannel := session.PlaygroundWS[sid]
channelRet := map[string]interface{}{}
if !result.Succ {
if nil != wsChannel {
channelRet["cmd"] = "run-done"
channelRet["output"] = ""
err := wsChannel.WriteJSON(&channelRet)
if nil != err {
logger.Warn(err)
return
}
wsChannel.Refresh()
}
channelRet["cmd"] = "run-done"
channelRet["output"] = ""
wsChannel.WriteJSON(&channelRet)
wsChannel.Refresh()
return
}