Skip to content

Commit

Permalink
hotfix: 입장, ETA 공지 알림 오지 않는 문제 해결 (#605)
Browse files Browse the repository at this point in the history
* fix: 입장 알림 토픽 추가

* fix: ETA NOTICE 로깅 추가
  • Loading branch information
hyeon0208 authored Sep 26, 2024
1 parent ccc71e6 commit 77af34d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@
import com.ody.util.TimeUtil;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.Comparator;
import java.util.List;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -62,6 +61,7 @@ private void scheduleEtaNotice(Meeting meeting) {
LocalDateTime etaNoticeTime = meeting.getMeetingTime().minusMinutes(ETA_NOTICE_TIME_DEFER);
Instant startTime = etaNoticeTime.toInstant(TimeUtil.KST_OFFSET);
taskScheduler.schedule(() -> fcmPushSender.sendNoticeMessage(noticeMessage), startTime);
log.info("{} 타입 알림 {}에 스케줄링 예약", NotificationType.ETA_NOTICE, startTime.atZone(TimeUtil.KST_OFFSET));
}

private String generateUniqueInviteCode() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static Notification createEntry(Mate mate, FcmTopic fcmTopic) {
NotificationType.ENTRY,
LocalDateTime.now(),
NotificationStatus.DONE,
null
fcmTopic
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import com.ody.notification.domain.message.DirectMessage;
import com.ody.notification.domain.message.GroupMessage;
import com.ody.notification.dto.request.FcmGroupSendRequest;
import com.ody.util.TimeUtil;
import java.time.Instant;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
Expand Down Expand Up @@ -52,6 +54,7 @@ private void updateDepartureReminderToDone(Notification notification) {
public void sendNoticeMessage(GroupMessage groupMessage) {
try {
FirebaseMessaging.getInstance().send(groupMessage.message());
log.info("공지 알림 전송 | 전송 시간 : {}", Instant.now().atZone(TimeUtil.KST_OFFSET));
} catch (FirebaseMessagingException exception) {
log.error("FCM 공지 전송 실패 : {}", exception.getMessage());
throw new OdyServerErrorException(exception.getMessage());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
import com.ody.util.TimeUtil;
import java.time.Instant;
import java.time.LocalDateTime;
import java.time.ZoneOffset;
import java.util.List;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -77,7 +76,7 @@ public void scheduleNotification(FcmGroupSendRequest fcmGroupSendRequest) {
"{} 타입 {} 상태 알림 {}에 스케줄링 예약",
fcmGroupSendRequest.notification().getType(),
fcmGroupSendRequest.notification().getStatus(),
startTime
startTime.atZone(TimeUtil.KST_OFFSET)
);
}

Expand Down

0 comments on commit 77af34d

Please sign in to comment.