Selaa lähdekoodia

rename oe cache keys..

deason 2 vuotta sitten
vanhempi
commit
56f3c6bf18

+ 2 - 1
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/AfterHandInExamJobHandler.java

@@ -3,6 +3,7 @@ package cn.com.qmth.examcloud.core.oe.task.service.job;
 import cn.com.qmth.examcloud.core.oe.student.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamRecordDataService;
+import cn.com.qmth.examcloud.support.CacheConstants;
 import cn.com.qmth.examcloud.support.Constants;
 import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
 import cn.com.qmth.examcloud.support.examing.ExamRecordData;
@@ -85,7 +86,7 @@ public class AfterHandInExamJobHandler {
     private void handler(Long examRecordDataId, int curTodoSize, int curTodoIndex) throws Exception {
         ExamRecordData examRecordDataCache = examRecordDataService.getExamRecordDataCache(examRecordDataId);
         if (examRecordDataCache == null) {
-            log.warn("redisKey OE_ERD:{} value not exist, Set examRecordStatus=EXAM_ERROR", examRecordDataId);
+            log.warn("redisKey {}{} value not exist, Set examRecordStatus=EXAM_ERROR", CacheConstants.CACHE_OE_RECORD, examRecordDataId);
             examRecordDataRepo.updateExamRecordStatusById(ExamRecordStatus.EXAM_ERROR, new Date(), examRecordDataId);
             return;
         }

+ 5 - 3
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/BeforeHandInExamJobHandler.java

@@ -6,6 +6,7 @@ import cn.com.qmth.examcloud.core.oe.student.dao.ExamRecordDataRepo;
 import cn.com.qmth.examcloud.core.oe.student.dao.entity.ExamRecordDataEntity;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamingSessionService;
+import cn.com.qmth.examcloud.support.CacheConstants;
 import cn.com.qmth.examcloud.support.Constants;
 import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
 import cn.com.qmth.examcloud.support.enums.HandInExamType;
@@ -100,7 +101,7 @@ public class BeforeHandInExamJobHandler {
     private void handler(Long examRecordDataId) throws Exception {
         ExamRecordData examRecordDataCache = examRecordDataService.getExamRecordDataCache(examRecordDataId);
         if (examRecordDataCache == null) {
-            log.warn("redisKey OE_ERD:{} value not exist, Set examRecordStatus=EXAM_ERROR", examRecordDataId);
+            log.warn("redisKey {}{} value not exist, Set examRecordStatus=EXAM_ERROR", CacheConstants.CACHE_OE_RECORD, examRecordDataId);
             examRecordDataRepo.updateExamRecordStatusById(ExamRecordStatus.EXAM_ERROR, new Date(), examRecordDataId);
             return;
         }
@@ -123,7 +124,8 @@ public class BeforeHandInExamJobHandler {
         ExamingSession examingSession = examingSessionService.getExamingSession(examRecordDataCache.getStudentId());
         if (examingSession == null) {
             // 考试会话不存在,则自动交卷
-            log.warn("redisKey OE_SESSION:{} value not exist, do autoHandInExam, examRecordDataId:{}", examRecordDataCache.getStudentId(), examRecordDataId);
+            log.warn("redisKey {}{} value not exist, do autoHandInExam, examRecordDataId:{}",
+                    CacheConstants.CACHE_OE_SESSION, examRecordDataCache.getStudentId(), examRecordDataId);
             this.autoHandInExam(examRecordDataCache);
             return;
         }
@@ -153,7 +155,7 @@ public class BeforeHandInExamJobHandler {
 
         long activeTime;
         if (activeTimeCache == null) {
-            log.warn("redisKey OE_ACTIVE:{} value not exist, examReconnectTime:{} minutes",
+            log.warn("redisKey {}{} value not exist, examReconnectTime:{} minutes", CacheConstants.CACHE_OE_ACTIVE,
                     examingSession.getExamRecordDataId(), examingSession.getExamReconnectTime());
             activeTime = System.currentTimeMillis();
         } else {

+ 2 - 1
examcloud-core-oe-task-service/src/main/java/cn/com/qmth/examcloud/core/oe/task/service/job/SyncExamRecordDataJobHandler.java

@@ -12,6 +12,7 @@ import cn.com.qmth.examcloud.core.oe.task.service.CommonService;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamBossService;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamRecordDataService;
 import cn.com.qmth.examcloud.core.oe.task.service.ExamingSessionService;
+import cn.com.qmth.examcloud.support.CacheConstants;
 import cn.com.qmth.examcloud.support.Constants;
 import cn.com.qmth.examcloud.support.enums.ExamProperties;
 import cn.com.qmth.examcloud.support.enums.ExamRecordStatus;
@@ -119,7 +120,7 @@ public class SyncExamRecordDataJobHandler {
     private void handler(Long examRecordDataId) throws Exception {
         ExamRecordData examRecordDataCache = examRecordDataService.getExamRecordDataCache(examRecordDataId);
         if (examRecordDataCache == null) {
-            log.warn("redisKey OE_ERD:{} value not exist, Set examRecordStatus=EXAM_ERROR", examRecordDataId);
+            log.warn("redisKey {}{} value not exist, Set examRecordStatus=EXAM_ERROR", CacheConstants.CACHE_OE_RECORD, examRecordDataId);
             examRecordDataRepo.updateExamRecordStatusById(ExamRecordStatus.EXAM_ERROR, new Date(), examRecordDataId);
             return;
         }