|
@@ -6,10 +6,12 @@ import cn.com.qmth.examcloud.commons.helpers.pipeline.NodeExecuter;
|
|
|
import cn.com.qmth.examcloud.commons.helpers.pipeline.TaskContext;
|
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLog;
|
|
|
import cn.com.qmth.examcloud.commons.logging.ExamCloudLogFactory;
|
|
|
+import cn.com.qmth.examcloud.core.oe.task.service.ExamingSessionService;
|
|
|
import cn.com.qmth.examcloud.support.Constants;
|
|
|
import cn.com.qmth.examcloud.support.enums.SyncStatus;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamBoss;
|
|
|
import cn.com.qmth.examcloud.support.examing.ExamRecordData;
|
|
|
+import cn.com.qmth.examcloud.support.examing.ExamingSession;
|
|
|
import cn.com.qmth.examcloud.support.redis.RedisKeyHelper;
|
|
|
import cn.com.qmth.examcloud.web.bootstrap.PropertyHolder;
|
|
|
import cn.com.qmth.examcloud.web.helpers.SequenceLockHelper;
|
|
@@ -31,6 +33,8 @@ public class ClearExamDataCacheExecutor implements NodeExecuter<Long, ExamRecord
|
|
|
|
|
|
@Autowired
|
|
|
private RedisClient redisClient;
|
|
|
+ @Autowired
|
|
|
+ private ExamingSessionService examingSessionService;
|
|
|
private static final ExamCloudLog LOG = ExamCloudLogFactory.getLog(ClearExamDataCacheExecutor.class);
|
|
|
|
|
|
/**
|
|
@@ -74,6 +78,12 @@ public class ClearExamDataCacheExecutor implements NodeExecuter<Long, ExamRecord
|
|
|
redisClient.delete(RedisKeyHelper.getBuilder().examingHeartbeatKey(examRecordDataId));
|
|
|
|
|
|
//清除考试会话缓存
|
|
|
+ ExamingSession examingSession = examingSessionService.getExamingSession(examRecordData.getStudentId());
|
|
|
+ if (null != examingSession && examingSession.getExamRecordDataId().equals(examRecordDataId)) {
|
|
|
+ String sessionKey = RedisKeyHelper.getBuilder().examingSessionKey(examRecordData.getStudentId());
|
|
|
+ redisClient.delete(sessionKey);
|
|
|
+ this.infoLog(String.format("清理交卷未删除的会话:%s", sessionKey), examRecordDataId);
|
|
|
+ }
|
|
|
redisClient.delete(RedisKeyHelper.getBuilder().examingSessionKey(examRecordData.getStudentId()));
|
|
|
|
|
|
//清除文件作答和普通作答记录缓存
|
|
@@ -132,4 +142,10 @@ public class ClearExamDataCacheExecutor implements NodeExecuter<Long, ExamRecord
|
|
|
LOG.debug("[CLEAR-EXAM-DATA-CACHE-EXECUTOR-" + examRecordDataId + "]:" + msg);
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ private void infoLog(String msg, Long examRecordDataId) {
|
|
|
+ if (LOG.isInfoEnabled()) {
|
|
|
+ LOG.info("[CLEAR-EXAM-DATA-CACHE-EXECUTOR-" + examRecordDataId + "]:" + msg);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|