Skip to content

Commit

Permalink
Merge pull request #6 from mju-likelion/feature/ignore-nano-seconds-#5
Browse files Browse the repository at this point in the history
Feature/#5 스케줄링 시 나노초는 무시하도록 변경
  • Loading branch information
Dh3356 authored Sep 22, 2024
2 parents c22c560 + ee16c5d commit 132d31d
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public Object getWeather() {

@Scheduled(fixedRate = 58000)
public void weatherScheduler() {
LocalTime nowTime = LocalTime.now();
LocalTime nowTime = LocalTime.now().withSecond(0).withNano(0);
LocalDate nowDate = LocalDate.now();
if (scheduleBaseTimes.contains(nowTime)) {
log.info("Update weather data");
Expand All @@ -79,8 +79,6 @@ public void weatherScheduler() {
}

public void updateWeather(final LocalDate date, final LocalTime time) {
System.out.println(date);
System.out.println(time);
String baseDate = formatDate(date);
String baseTime = formatTime(time);
String argString = weatherApiArgsProvider.getArgs(baseDate, baseTime);
Expand Down

0 comments on commit 132d31d

Please sign in to comment.