diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java index a51442af..f7b9ac1d 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/common/exception/CloudHandler.java @@ -18,7 +18,7 @@ import java.util.concurrent.TimeUnit; /** * @Author: Himit_ZH * @Date: 2020/10/30 10:21 - * @Description: + * @Description: 调用判题服务器的方法的容错机制,调用失败会走到以下方法进行执行 */ @Component @RefreshScope @@ -34,9 +34,9 @@ public class CloudHandler implements ToJudgeService { @Override public CommonResult submitProblemJudge(ToJudge toJudge) { - // 线程沉睡两秒,再将任务重新发布,避免过快问题,同时判题服务过多,导致的失败 + // 线程沉睡一秒,再将任务重新发布,避免过快问题,同时判题服务过多,导致的失败 try { - TimeUnit.SECONDS.sleep(2); + TimeUnit.SECONDS.sleep(1); } catch (InterruptedException e) { e.printStackTrace(); } diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java index b32e6b4d..562376ec 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeDispatcher.java @@ -11,9 +11,7 @@ import top.hcode.hoj.dao.JudgeMapper; import top.hcode.hoj.pojo.entity.ContestRecord; import top.hcode.hoj.pojo.entity.Judge; import top.hcode.hoj.pojo.entity.ProblemCount; -import top.hcode.hoj.pojo.entity.ToJudge; import top.hcode.hoj.service.impl.ContestRecordServiceImpl; -import top.hcode.hoj.service.impl.JudgeServiceImpl; import top.hcode.hoj.service.impl.ProblemCountServiceImpl; import top.hcode.hoj.utils.Constants; import top.hcode.hoj.utils.RedisUtils; @@ -21,7 +19,7 @@ import top.hcode.hoj.utils.RedisUtils; /** * @Author: Himit_ZH * @Date: 2021/2/5 16:44 - * @Description: + * @Description: 判题信息的发布者,通过主题发布到特定频道内 */ @Component @Slf4j @@ -51,7 +49,6 @@ public class JudgeDispatcher { redisUtils.sendMessage(Constants.Judge.STATUS_JUDGE_WAITING.getName(), JSONUtil.toJsonStr(task)); } catch (Exception e) { log.error("调用redis消息发布异常,此次判题任务判为系统错误--------------->{}", e.getMessage()); - UpdateWrapper judgeUpdateWrapper = new UpdateWrapper<>(); judgeUpdateWrapper.eq("submit_id", submitId) .set("error_message", "The something has gone wrong with the data Backup server. Please report this to administrator.") diff --git a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java index b2ca4a65..a5a273f2 100644 --- a/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java +++ b/hoj-springboot/DataBackup/src/main/java/top/hcode/hoj/judge/JudgeReceiver.java @@ -19,6 +19,9 @@ import top.hcode.hoj.service.impl.JudgeServiceImpl; * @Author: Himit_ZH * @Date: 2021/2/5 16:43 * @Description: + * 1. 判题信息的接受者,调用判题服务,对提交代码进行判断, + * 2. 若无空闲判题服务器,会自动进入熔断机制,重新将该判题信息发布到频道内, + * 3. 再次接受到信息,再次查询是否有空闲判题服务器,若有则进行判题,否则回到2 */ @Component public class JudgeReceiver implements MessageListener { diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeDispatcher.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeDispatcher.class index 0556da0d..98c8c469 100644 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeDispatcher.class and b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeDispatcher.class differ diff --git a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeReceiver.class b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeReceiver.class index ba2c54e0..4bc0ccb3 100644 Binary files a/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeReceiver.class and b/hoj-springboot/DataBackup/target/classes/top/hcode/hoj/judge/JudgeReceiver.class differ diff --git a/hoj-vue/src/App.vue b/hoj-vue/src/App.vue index 436070a2..a85948a6 100644 --- a/hoj-vue/src/App.vue +++ b/hoj-vue/src/App.vue @@ -1,33 +1,40 @@ @@ -88,25 +95,25 @@ pre, samp { font-family: Consolas, Menlo, Courier, monospace; } -#admin-content{ - background-color: #1E9FFF; - position:absolute; +#admin-content { + background-color: #1e9fff; + position: absolute; top: 0; bottom: 0; width: 100%; } -.mobile-menu-active{ - background-color: rgba(0,0,0,.1); +.mobile-menu-active { + background-color: rgba(0, 0, 0, 0.1); } -.mobile-menu-active .mu-item-title{ - color: #2d8cf0!important; +.mobile-menu-active .mu-item-title { + color: #2d8cf0 !important; } -.mobile-menu-active .mu-icon{ - color: #2d8cf0!important; +.mobile-menu-active .mu-icon { + color: #2d8cf0 !important; } -#particles-js{ - position:fixed; - z-index:0; +#particles-js { + position: fixed; + z-index: 0; top: 0; left: 0; right: 0; @@ -121,7 +128,7 @@ a { transition: color 0.2s ease; } a:hover { - color: #2196f3!important; + color: #2196f3 !important; } .panel-title { font-size: 21px; @@ -181,9 +188,9 @@ a:hover { font-size: 12px !important; font-weight: 500 !important; } -.row--hover{ +.row--hover { cursor: pointer; - background-color: #ebf7ff!important; + background-color: #ebf7ff !important; } .vxe-table .vxe-body--column:not(.col--ellipsis), .vxe-table .vxe-footer--column:not(.col--ellipsis), @@ -198,8 +205,8 @@ a:hover { margin-top: 80px; padding: 0 4%; } - .vxe-table--body-wrapper{ - overflow-x: hidden!important; + .vxe-table--body-wrapper { + overflow-x: hidden !important; } } .markdown-body img { @@ -250,11 +257,11 @@ a:hover { min-width: 120px !important; text-align: center; } -.panel-options{ - margin-top:10px; +.panel-options { + margin-top: 10px; text-align: center; } -.el-tag--dark{ - border-color: #FFF!important; +.el-tag--dark { + border-color: #fff !important; } diff --git a/hoj-vue/src/components/oj/common/CodeMirror.vue b/hoj-vue/src/components/oj/common/CodeMirror.vue index 58cbfb3a..d901f202 100644 --- a/hoj-vue/src/components/oj/common/CodeMirror.vue +++ b/hoj-vue/src/components/oj/common/CodeMirror.vue @@ -239,7 +239,7 @@ export default { height: auto !important; } .CodeMirror-scroll { - min-height: 520px; - max-height: 520px; + min-height: 549px; + max-height: 1000px; } diff --git a/hoj-vue/src/store/index.js b/hoj-vue/src/store/index.js index ae20636c..fe0a6a2a 100644 --- a/hoj-vue/src/store/index.js +++ b/hoj-vue/src/store/index.js @@ -9,7 +9,12 @@ const rootState = { mode: 'Login', // or 'register', visible: false }, - websiteConfig:{}, + websiteConfig:{ + recordName:'粤ICP备×××××××号-1', + projectName:'HOJ', + recordUrl:'#', + projectUrl:'#' + }, registerTimeOut: 60, resetTimeOut: 90, } diff --git a/hoj-vue/src/views/oj/problem/Problem.vue b/hoj-vue/src/views/oj/problem/Problem.vue index c7351775..beeead30 100644 --- a/hoj-vue/src/views/oj/problem/Problem.vue +++ b/hoj-vue/src/views/oj/problem/Problem.vue @@ -3,8 +3,8 @@
- - + +
{{ problemData.problem.title }}
@@ -124,8 +124,13 @@
- - + +