Skip to content

Commit

Permalink
Fix: 과릿 1.1.4 (#320)
Browse files Browse the repository at this point in the history
* Fix: 과릿 1.1.4 (#319)
  • Loading branch information
dl-00-e8 authored Nov 15, 2023
1 parent 7f226b9 commit 430f9ad
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@
import org.springframework.stereotype.Component;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.format.DateTimeFormatter;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;
import java.util.stream.Collectors;

@Slf4j
Expand All @@ -36,9 +38,12 @@ public RepeatStatus execute(StepContribution contribution, ChunkContext chunkCon
log.info(chunkContext.toString());

List<Message> messageList = new ArrayList<>();
Random random = new Random();
int sleepTime = random.nextInt(9) + 1;
Thread.sleep(sleepTime * 1000);
List<Long> lessonIdList = lessonRepository.findTodayLessonIdByDate(LocalDate.now());
List<BatchNotificationDto> batchNotificationDtoList = lessonRepository.findAllByDate(lessonIdList);
lessonRepository.updateLessonProcessingByDate(lessonIdList);
List<BatchNotificationDto> batchNotificationDtoList = lessonRepository.findAllByDate(lessonIdList);
for(BatchNotificationDto notificationDto : batchNotificationDtoList) {
String title = "오늘은 수업이 총 " + notificationDto.getLessonList().size() + "개 있어요." + "\n";
StringBuilder body = new StringBuilder();
Expand Down

0 comments on commit 430f9ad

Please sign in to comment.