Skip to content

Commit

Permalink
Add kr time zone in push notification
Browse files Browse the repository at this point in the history
  • Loading branch information
minkukjo committed Sep 2, 2024
1 parent 5723350 commit 579c512
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

import com.nexters.gaetteok.firebase.service.PushNotificationService;
import com.nexters.gaetteok.user.application.UserApplication;
import java.time.LocalDateTime;
import java.time.ZoneId;
import java.time.ZonedDateTime;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.coyote.BadRequestException;
Expand All @@ -23,7 +24,7 @@ public class PushNotificationScheduler {

@Scheduled(fixedDelay = 60000)
public void run() {
LocalDateTime now = LocalDateTime.now();
ZonedDateTime now = ZonedDateTime.now(ZoneId.of("Asia/Seoul"));
int targetMinute = (now.getHour() * 60) + now.getMinute();
userApplication.getPushNotificationByMinute(targetMinute).forEach(
pushNotification -> {
Expand Down

0 comments on commit 579c512

Please sign in to comment.