|
@@ -11,7 +11,6 @@ import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
-import com.qmth.themis.business.cache.ExamActivityRecordCacheUtil;
|
|
|
import com.qmth.themis.business.cache.ExamRecordCacheUtil;
|
|
|
import com.qmth.themis.business.cache.RedisKeyHelper;
|
|
|
import com.qmth.themis.business.constant.SystemConstant;
|
|
@@ -46,18 +45,20 @@ public class CommonServiceImpl implements CommonService {
|
|
|
String lockKey = SystemConstant.REDIS_LOCK_EXAM_RECORD_PERSISTED_PREFIX + recordId;
|
|
|
Boolean lock = redisUtil.lock(lockKey, SystemConstant.REDIS_CACHE_TIME_OUT);
|
|
|
if (!lock) {
|
|
|
- log.debug("persisted doing,request ignore");
|
|
|
+ log.debug("persisted doing,request ignore recordId:"+recordId);
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
try {
|
|
|
ExamRecordStatusEnum status = ExamRecordCacheUtil.getStatus(recordId);
|
|
|
if (!ExamRecordStatusEnum.FINISHED.equals(status)) {
|
|
|
+ log.debug("status error ,status:"+status.name()+" recordId:"+recordId);
|
|
|
return;
|
|
|
}
|
|
|
Double score = ExamRecordCacheUtil.getObjectiveScore(recordId);
|
|
|
if (score == null) {
|
|
|
- //算分未完成的 发送5秒延迟消息
|
|
|
+ log.debug("score is null ,recordId:"+recordId);
|
|
|
+ //算分未完成的 发送10秒延迟消息
|
|
|
Map<String, Object> transMap = new HashMap<String, Object>();
|
|
|
transMap.put("recordId", recordId);
|
|
|
String level = "10s";
|
|
@@ -75,6 +76,7 @@ public class CommonServiceImpl implements CommonService {
|
|
|
return;
|
|
|
}
|
|
|
|
|
|
+ log.debug("start persisted,recordId:"+recordId);
|
|
|
examRecordService.saveDataByCache(recordId);
|
|
|
// 清除缓存
|
|
|
// ExamActivityRecordCacheUtil.removeActivityRecordCache(ExamRecordCacheUtil.getExamActivityId(recordId),
|
|
@@ -84,6 +86,7 @@ public class CommonServiceImpl implements CommonService {
|
|
|
redisUtil.delete(RedisKeyHelper.audioLeftPlayCountKey(recordId));
|
|
|
redisUtil.delete(RedisKeyHelper.livenessVerifyCacheKey(recordId));
|
|
|
redisUtil.delete(RedisKeyHelper.faceVerifyCacheKey(recordId));
|
|
|
+ log.debug("end persisted,recordId:"+recordId);
|
|
|
} finally {
|
|
|
redisUtil.releaseLock(lockKey);
|
|
|
}
|