🎨 执行超时反馈

This commit is contained in:
Liang Ding 2019-05-16 13:46:53 +08:00
parent 0d36d56631
commit 8058946f14
No known key found for this signature in database
GPG Key ID: 136F30F901A2231D
1 changed files with 6 additions and 1 deletions

View File

@ -260,7 +260,12 @@ func RunHandler(w http.ResponseWriter, r *http.Request) {
}
cmd.Wait()
logger.Warn("process", cmd.ProcessState)
if 124 == cmd.ProcessState.ExitCode() {
channelRet["cmd"] = "run-done"
channelRet["output"] = "run program timeout"
wsChannel.WriteJSON(&channelRet)
wsChannel.Refresh()
}
}(rand.Int())
}