From b1738e61b4f0ec010cd49dbfc7d7e8478a84add3 Mon Sep 17 00:00:00 2001 From: Himit_ZH <372347736@qq.com> Date: Thu, 14 Oct 2021 21:57:40 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3cf=E6=8F=90=E4=BA=A4=E5=A4=B1?= =?UTF-8?q?=E8=B4=A5=E7=9A=84=E6=83=85=E5=86=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/top/hcode/hoj/remoteJudge/RemoteJudgeGetResult.java | 2 ++ .../java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java | 3 ++- .../top/hcode/hoj/remoteJudge/task/Impl/CodeForcesJudge.java | 4 ++-- hoj-vue/src/views/oj/status/SubmissionList.vue | 1 + 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeGetResult.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeGetResult.java index 9b44b469..c0164d8e 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeGetResult.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeGetResult.java @@ -5,6 +5,7 @@ import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; import top.hcode.hoj.pojo.entity.Judge; @@ -36,6 +37,7 @@ public class RemoteJudgeGetResult { private RemoteJudgeAccountServiceImpl remoteJudgeAccountService; @Transactional + @Async public void sendTask(String remoteJudge, String username, String password, Long submitId, String uid, Long cid, Long pid, Long resultSubmitId, String cookies) { diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java index 2f93d838..cab9a66b 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/RemoteJudgeToSubmit.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Component; import top.hcode.hoj.pojo.entity.Judge; import top.hcode.hoj.pojo.entity.RemoteJudgeAccount; @@ -33,7 +34,7 @@ public class RemoteJudgeToSubmit { @Value("${hoj-judge-server.name}") private String name; - + @Async public void sendTask(String username, String password, String remoteJudge, String remotePid, Long submitId, String uid, Long cid, Long pid, String language, String userCode) { diff --git a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/task/Impl/CodeForcesJudge.java b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/task/Impl/CodeForcesJudge.java index a2507b32..2ff7eee8 100644 --- a/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/task/Impl/CodeForcesJudge.java +++ b/hoj-springboot/JudgeServer/src/main/java/top/hcode/hoj/remoteJudge/task/Impl/CodeForcesJudge.java @@ -184,7 +184,7 @@ public class CodeForcesJudge implements RemoteJudgeStrategy { //CSS渲染禁止 webClient.getOptions().setCssEnabled(false); //超时时间 - webClient.getOptions().setTimeout(6000); + webClient.getOptions().setTimeout(4000); //设置js抛出异常:false webClient.getOptions().setThrowExceptionOnScriptError(false); @@ -216,7 +216,7 @@ public class CodeForcesJudge implements RemoteJudgeStrategy { } public void submitCode(WebClient webClient, String problemID, String languageID, String code) throws IOException { - webClient.getOptions().setTimeout(30000); + webClient.getOptions().setTimeout(40000); // 模拟浏览器打开一个目标网址 HtmlPage page = webClient.getPage(HOST + SUBMIT_URL); diff --git a/hoj-vue/src/views/oj/status/SubmissionList.vue b/hoj-vue/src/views/oj/status/SubmissionList.vue index 17ce1b2d..8a882f64 100644 --- a/hoj-vue/src/views/oj/status/SubmissionList.vue +++ b/hoj-vue/src/views/oj/status/SubmissionList.vue @@ -394,6 +394,7 @@ export default { }, methods: { init() { + this.checkStatusNum = 0; this.contestID = this.$route.params.contestID; let query = this.$route.query; this.formFilter.problemID = query.problemID;