From a23dd7825626a9a6de45feb0f4c405a617a4f339 Mon Sep 17 00:00:00 2001 From: Sejeong Kim Date: Tue, 5 Nov 2024 16:38:23 +0900 Subject: [PATCH] chore: scheduler test --- .../inong/common/scheduler/DeliveryNotificationScheduler.java | 2 +- .../inong/domain/notification/service/NotificationService.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/product/src/main/java/org/samtuap/inong/common/scheduler/DeliveryNotificationScheduler.java b/backend/product/src/main/java/org/samtuap/inong/common/scheduler/DeliveryNotificationScheduler.java index e06a18a7..f7df78ef 100644 --- a/backend/product/src/main/java/org/samtuap/inong/common/scheduler/DeliveryNotificationScheduler.java +++ b/backend/product/src/main/java/org/samtuap/inong/common/scheduler/DeliveryNotificationScheduler.java @@ -15,7 +15,7 @@ public class DeliveryNotificationScheduler { private final NotificationService notificationService; @SchedulerLock(name = "shedLock_notify_delivery", lockAtLeastFor = "1m", lockAtMostFor = "59m") - @Scheduled(cron = "0 0 15 * * *") + @Scheduled(cron = "0 0 7 * * *") public void notifyTodayDelivery() { notificationService.notifyTodayDelivery(); } diff --git a/backend/product/src/main/java/org/samtuap/inong/domain/notification/service/NotificationService.java b/backend/product/src/main/java/org/samtuap/inong/domain/notification/service/NotificationService.java index a1b3817d..714139dd 100644 --- a/backend/product/src/main/java/org/samtuap/inong/domain/notification/service/NotificationService.java +++ b/backend/product/src/main/java/org/samtuap/inong/domain/notification/service/NotificationService.java @@ -54,7 +54,7 @@ public void notifyTodayDelivery() { Long todayCount = orderFeign.getDeliveryCountByFarmId(farm.getId(), LocalDate.now().toString()); Long tomorrowCount = orderFeign.getDeliveryCountByFarmId(farm.getId(), LocalDate.now().plusDays(1).toString()); - if(todayCount == 0L || tomorrowCount == 0L) { + if(todayCount == 0L && tomorrowCount == 0L) { continue; }