Browse Source

Fix judge status cache broken when rough result is queried

pull/6/head
Menci 6 years ago
parent
commit
3b0b1661c7
  1. 14
      libs/submissions_process.js

14
libs/submissions_process.js

@ -15,15 +15,17 @@ const getSubmissionInfo = (s, displayConfig) => ({
const getRoughResult = (x, displayConfig, roughOnly) => { const getRoughResult = (x, displayConfig, roughOnly) => {
if (displayConfig.showResult) { if (displayConfig.showResult) {
if (x.pending) { if (x.pending) {
let res = getCachedJudgeState(x.task_id) || null let res = getCachedJudgeState(x.task_id) || null;
if (!res) return null; if (!res) return null;
if (roughOnly) { if (roughOnly) {
res.result = 'Judging'; return Object.assign({}, res, {
res.time = res.memory = res.score = 0; result: 'Judging',
} time: 0,
memory: 0,
return res; score: 0
});
} else return res;
} else { } else {
return { return {
result: x.status, result: x.status,

Loading…
Cancel
Save