Skip to content

Commit

Permalink
Hotfix (#33)
Browse files Browse the repository at this point in the history
* hotfix 수정

* IndexOutOfBounds 에러 찾는중

* isQuizAvailable.get(quizId) -> get(quizId-1) hotfix
  • Loading branch information
bjh3311 authored Aug 23, 2024
1 parent 989af40 commit 9959bdb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Deploy To EC2

on:
push:
branches: [ "main"]
branches: [ "main" , "hotfix"]

jobs:
deploy:
Expand Down
7 changes: 3 additions & 4 deletions src/main/java/newCar/event_page/service/UserServiceImpl.java
Original file line number Diff line number Diff line change
Expand Up @@ -105,9 +105,8 @@ public ResponseEntity<UserQuizDTO> getQuiz(Long quizEventId ) {
Quiz todayQuiz = quizRepository.findByPostDate(LocalDate.now(ZoneId.of("Asia/Seoul")))
.orElseThrow(() -> new NoSuchElementException("오늘 날짜에 해당하는 퀴즈 이벤트가 존재하지 않습니다."));

if(isQuizAvailable.size()<todayQuiz.getId().intValue()){
System.out.println("isQuizAvailable size : " + isQuizAvailable.size());
System.out.println("todayQuiz.getId().intValue() : " + todayQuiz.getId().intValue());
if(LocalDateTime.now(ZoneId.of("Asia/Seoul"))
.isAfter(eventCommonRepository.findById(1L).get().getEndTime())){
throw new IndexOutOfBoundsException("이벤트 기간이 지났습니다");
}

Expand Down Expand Up @@ -363,7 +362,7 @@ private void quizBranch(Integer userAnswer, Long id, Map<String, UserQuizStatus>

int quizId = Integer.parseInt(todayQuiz.getId().toString());

if(!isQuizAvailable.get(quizId)){
if(!isQuizAvailable.get(quizId-1)){
map.put("status", UserQuizStatus.END);
return;
}//이미 마감되어 있다면
Expand Down

0 comments on commit 9959bdb

Please sign in to comment.