diff --git a/weather-service/src/main/java/com/waither/weatherservice/batch/DailyWeatherTasklet.java b/weather-service/src/main/java/com/waither/weatherservice/batch/DailyWeatherTasklet.java index 69491f03..da6bc41d 100644 --- a/weather-service/src/main/java/com/waither/weatherservice/batch/DailyWeatherTasklet.java +++ b/weather-service/src/main/java/com/waither/weatherservice/batch/DailyWeatherTasklet.java @@ -22,9 +22,9 @@ public class DailyWeatherTasklet implements Tasklet { private final WeatherService weatherService; @Override - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { - LocalDateTime now = LocalDateTime.now(); - String[] dateTime = weatherService.convertLocalDateTimeToString(now).split("_"); + public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { + LocalDateTime baseTime = LocalDateTime.now().minusHours(1); + String[] dateTime = weatherService.convertLocalDateTimeToString(baseTime).split("_"); List regionList = weatherService.getRegionList(); regionList.stream() .forEach(region -> { diff --git a/weather-service/src/main/java/com/waither/weatherservice/batch/ExpectedWeatherTasklet.java b/weather-service/src/main/java/com/waither/weatherservice/batch/ExpectedWeatherTasklet.java index 314e67ce..d901dc87 100644 --- a/weather-service/src/main/java/com/waither/weatherservice/batch/ExpectedWeatherTasklet.java +++ b/weather-service/src/main/java/com/waither/weatherservice/batch/ExpectedWeatherTasklet.java @@ -22,9 +22,9 @@ public class ExpectedWeatherTasklet implements Tasklet { private final WeatherService weatherService; @Override - public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) throws Exception { - LocalDateTime now = LocalDateTime.now(); - String[] dateTime = weatherService.convertLocalDateTimeToString(now).split("_"); + public RepeatStatus execute(StepContribution contribution, ChunkContext chunkContext) { + LocalDateTime baseTime = LocalDateTime.now().minusHours(1); + String[] dateTime = weatherService.convertLocalDateTimeToString(baseTime).split("_"); List regionList = weatherService.getRegionList(); regionList.stream() .forEach(region -> { diff --git a/weather-service/src/main/java/com/waither/weatherservice/openapi/OpenApiUtil.java b/weather-service/src/main/java/com/waither/weatherservice/openapi/OpenApiUtil.java index 01e8424c..ffc66ad6 100644 --- a/weather-service/src/main/java/com/waither/weatherservice/openapi/OpenApiUtil.java +++ b/weather-service/src/main/java/com/waither/weatherservice/openapi/OpenApiUtil.java @@ -150,7 +150,6 @@ public String convertLocalDateToString(LocalDate localDate) { return localDate.format(formatter); } - // TODO AccuWeather 대기 정보로 변경 예정 public List callAirKorea(String searchDate) throws URISyntaxException { int pageNo = 1; int numOfRows = 10;