From 84cdf088ace05484afa675b658d4ea8055b452e1 Mon Sep 17 00:00:00 2001 From: BlueBerrySoda Date: Mon, 3 Jun 2024 01:28:32 +0900 Subject: [PATCH] =?UTF-8?q?refactor:=20=EB=A9=94=EB=89=B4=20=ED=81=AC?= =?UTF-8?q?=EB=A1=A4=EB=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../capstone/domain/menu/service/MenuCrawlingService.java | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/back/src/main/java/com/example/capstone/domain/menu/service/MenuCrawlingService.java b/back/src/main/java/com/example/capstone/domain/menu/service/MenuCrawlingService.java index 8a6b9be310..6535b5b2a0 100644 --- a/back/src/main/java/com/example/capstone/domain/menu/service/MenuCrawlingService.java +++ b/back/src/main/java/com/example/capstone/domain/menu/service/MenuCrawlingService.java @@ -25,12 +25,10 @@ public boolean testKeyCheck(String key){ else throw new BusinessException(TEST_KEY_NOT_VALID); } - @Scheduled(cron = "0 0 4 * * MON") + @Scheduled(cron = "0 0,7,14,21,28,35,42 4 * * MON") public void crawlingMenus(){ LocalDate startDay = LocalDate.now(); - - for(int i=0; i<7; i++){ - menuUpdateService.updateMenus(startDay.plusDays(i)); - } + int i = LocalDateTime.now().getMinute() / 7; + menuUpdateService.updateMenus(startDay.plusDays(i)); } }