From cc78058d2312749600a1ac35660e044ca746e853 Mon Sep 17 00:00:00 2001 From: tangjiang <465264938@qq.com> Date: Fri, 17 Jan 2020 21:29:22 +0800 Subject: [PATCH] update wxcode --- public/react/src/redux/actions/wxCode.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/public/react/src/redux/actions/wxCode.js b/public/react/src/redux/actions/wxCode.js index e62e6facc..89b813e7b 100644 --- a/public/react/src/redux/actions/wxCode.js +++ b/public/react/src/redux/actions/wxCode.js @@ -4,7 +4,7 @@ * @Github: * @Date: 2020-01-15 15:41:10 * @LastEditors : tangjiang - * @LastEditTime : 2020-01-17 21:06:46 + * @LastEditTime : 2020-01-17 21:28:23 */ import types from './actionTypes.js'; import { @@ -133,10 +133,12 @@ export const evaluateWxCode = (identifier, path) => { // 定时调用 game_status fetchWxCodeGameStatus let count = 1; const intervalTime = 500; + let time_out = false; function wxCodeGameStatus (intervalTime, finalTime, count, timer) { const excuteTime = (count++) * intervalTime; // 当前执行时间 console.log(finalTime, count, excuteTime); - fetchWxCodeGameStatus(identifier, {resubmit: _resubmit}).then(r => { + if ((excuteTime / 1000) > (finalTime + 1)) time_out = true; + fetchWxCodeGameStatus(identifier, {resubmit: _resubmit, time_out}).then(r => { const { status, test_sets = [], gold, experience, next_game, sets_error_count } = r.data; if (+status > -1 || ((excuteTime / 1000) > (finalTime + 1))) { clearInterval(timer);