From 1121bf380d1d0977a3d7ace3fd9e51db7ca37e63 Mon Sep 17 00:00:00 2001 From: t123yh Date: Thu, 24 Aug 2017 15:33:10 +0800 Subject: [PATCH] Fix rough progress showing running even if it's finished. --- src/daemon-frontend-syzoj/socketio.ts | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/daemon-frontend-syzoj/socketio.ts b/src/daemon-frontend-syzoj/socketio.ts index 408491c..c9cd7c9 100644 --- a/src/daemon-frontend-syzoj/socketio.ts +++ b/src/daemon-frontend-syzoj/socketio.ts @@ -189,19 +189,20 @@ export function initializeSocketIO(s: http.Server) { roughProgressNamespace = initializeNamespace('rough', async (req, socket) => { const taskId = req.taskId; - if (currentJudgeList[taskId]) { - return { - ok: true, - running: true, - finished: false - }; - } else if (finishedJudgeList[taskId]) { + if (finishedJudgeList[taskId]) { return { ok: true, running: false, finished: true, result: processRoughResult(finishedJudgeList[taskId], clientDisplayConfigList[socket.id]) }; + } + else if (currentJudgeList[taskId]) { + return { + ok: true, + running: true, + finished: false + }; } else { return { ok: true,