diff --git a/src/main/java/com/spaceclub/user/service/AccountDeleteScheduler.java b/src/main/java/com/spaceclub/user/service/AccountDeleteScheduler.java index e93815c3..b9c85ffb 100644 --- a/src/main/java/com/spaceclub/user/service/AccountDeleteScheduler.java +++ b/src/main/java/com/spaceclub/user/service/AccountDeleteScheduler.java @@ -4,6 +4,7 @@ import com.spaceclub.user.domain.User; import com.spaceclub.user.repository.UserRepository; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; import org.springframework.scheduling.annotation.Async; import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; @@ -11,6 +12,7 @@ import java.time.LocalDateTime; import java.util.List; +@Slf4j @Component @RequiredArgsConstructor public class AccountDeleteScheduler { @@ -26,11 +28,12 @@ public class AccountDeleteScheduler { // @Scheduled(cron = "0 0 0 * * *", zone = "Asia/Seoul") @Scheduled(fixedRate = 1000 * 60) // 테스트 public void deleteInactiveUsers() { + log.warn("deleteInactiveUsers() is called"); // LocalDateTime threeDaysAgoFromNow = LocalDateTime.now().minusDays(GRACE_DAYS_OF_DELETION); LocalDateTime threeDaysAgoFromNow = LocalDateTime.now().minusMinutes(GRACE_DAYS_OF_DELETION); List usersToDelete = userRepository.findAllUserToDelete(threeDaysAgoFromNow).stream() - .map(User::changeStatusToDeleted) .peek(kakaoOauthInfoSender::unlink) + .map(User::changeStatusToDeleted) .toList(); userRepository.saveAll(usersToDelete);