From 1130c4b2bebe1185bad38d3a5e5556556e977a99 Mon Sep 17 00:00:00 2001 From: 670788339 <670788339@qq.com> Date: Thu, 9 May 2024 16:26:09 +0800 Subject: [PATCH] =?UTF-8?q?=E8=80=83=E8=AF=95=E9=87=8D=E5=A4=8D=E6=8F=90?= =?UTF-8?q?=E4=BA=A4=E5=88=A4=E6=96=AD-=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../school/study/service/impl/StudyExamServiceImpl.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java index f89d21f6..ae7fa0fb 100644 --- a/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java +++ b/servers/boe-server-all/src/main/java/com/xboe/school/study/service/impl/StudyExamServiceImpl.java @@ -54,6 +54,11 @@ public class StudyExamServiceImpl implements IStudyExamService{ @Transactional public String save(StudyExam exam) { String key = exam.getStudyId() + "_" + exam.getContentId(); + try { + Thread.sleep(3000L); + } catch (InterruptedException e) { + e.printStackTrace(); + } //判断是否存在redis if(StringUtils.isNotEmpty(redisTemplate.opsForValue().get(key))){ log.info("------------试卷提交验证中,请等待! "); @@ -63,7 +68,7 @@ public class StudyExamServiceImpl implements IStudyExamService{ redisTemplate.opsForValue().set(key,key); //设置过期时间为1天 redisTemplate.expire(key, 2, TimeUnit.SECONDS); - log.info("------------设置redis-key ,请等待! " + LocalDateTime.now()); + log.info("------------设置redis-key ,请等待! " + LocalDateTime.now() + ", key = " + redisTemplate.opsForValue().get(key)); //用于计算考试成绩 CourseExam cexam=cexamDao.get(exam.getTestId());