|
|
@ -587,7 +587,7 @@ class MainContentContainer extends Component {
|
|
|
|
|
|
|
|
|
|
|
|
// var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数
|
|
|
|
// var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.setEvaluateMiddleStatusText('')
|
|
|
|
this.setState({
|
|
|
|
this.setState({
|
|
|
|
gameBuilding: true
|
|
|
|
gameBuilding: true
|
|
|
|
})
|
|
|
|
})
|
|
|
@ -611,6 +611,9 @@ class MainContentContainer extends Component {
|
|
|
|
this.setGameBuildFalse()
|
|
|
|
this.setGameBuildFalse()
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
setEvaluateMiddleStatusText = (msg) => {
|
|
|
|
|
|
|
|
window.$('#evaluateMiddleStatusText').html(msg)
|
|
|
|
|
|
|
|
}
|
|
|
|
// 之前的task_commit方法
|
|
|
|
// 之前的task_commit方法
|
|
|
|
gameBuild(fileUpdateResponse, first) {
|
|
|
|
gameBuild(fileUpdateResponse, first) {
|
|
|
|
const { st, challenge, output_sets, onRunCodeTestFinish, resetTestSetsExpandedArray, showSnackbar, time_limit } = this.props
|
|
|
|
const { st, challenge, output_sets, onRunCodeTestFinish, resetTestSetsExpandedArray, showSnackbar, time_limit } = this.props
|
|
|
@ -641,14 +644,18 @@ class MainContentContainer extends Component {
|
|
|
|
axios.get(game_status_url, {
|
|
|
|
axios.get(game_status_url, {
|
|
|
|
withCredentials: true,
|
|
|
|
withCredentials: true,
|
|
|
|
}).then((gameStatusResponse) => {
|
|
|
|
}).then((gameStatusResponse) => {
|
|
|
|
requestTimes++;
|
|
|
|
requestTimes++;
|
|
|
|
if(!gameStatusResponse.data) {
|
|
|
|
const { status, running_code_message } = gameStatusResponse.data;
|
|
|
|
if(requestTimes >= timeOut - 1){ // 最后一次参数改为true
|
|
|
|
|
|
|
|
timeOutFlag = true;
|
|
|
|
if(!gameStatusResponse.data || !status && status !== 0 ) {
|
|
|
|
}
|
|
|
|
if(requestTimes >= timeOut - 1) { // 最后一次参数改为true
|
|
|
|
|
|
|
|
timeOutFlag = true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
if (running_code_message) {
|
|
|
|
|
|
|
|
this.setEvaluateMiddleStatusText(running_code_message)
|
|
|
|
|
|
|
|
}
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const { status } = gameStatusResponse.data;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (timeOutFlag === false && (status === 2 || status === 0)) {
|
|
|
|
if (timeOutFlag === false && (status === 2 || status === 0)) {
|
|
|
|
// 网络太慢或服务处理较慢的情况下,可能这里会执行第二次
|
|
|
|
// 网络太慢或服务处理较慢的情况下,可能这里会执行第二次
|
|
|
|