[feat] 장기 미접속 사용자 자동 탈퇴 및 알림 스케줄러 구현#171
Merged
saokiritoni merged 7 commits intofeat/#155-schedulerfrom Jan 14, 2026
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌱 관련 이슈
🌱 작업 사항
사용자의 자발적 탈퇴가 저조할 것으로 예상됨에 따라, 리소스 관리 및 보안 강화를 위해 장기 미접속 계정을 자동으로 관리하는 시스템을 구축했습니다. 매일 오전 09:00에 스케줄러가 실행되어 경고 알림 → Soft Delete (비활성화) → Hard Delete (영구 삭제) 프로세스를 수행합니다.
1. DB 스키마 및 Entity 수정 (User)
[필요한 필드 추가]
[연관관계 추가]
2. 비즈니스 로직 구현
[로그인 (UserLoginService)]
[스케줄러 (UserSchedulerService)]
3. 메시지 관리 리팩토링
4. UserRepository
Q. 활동이 없는 유저(Inactive User) 판단 기준은? UserRepository.findInactiveUsers 쿼리에서 판별합니다.
lastLoginAt이 3개월 지남 AND MAX(requests.expiresAt)이 3개월 지남 (혹은 기록 없음)Q. 알림 및 삭제 흐름
🌱 참고 사항
1년 -> 학기 단위로 작동하도록 학사일정 확인하도록 조정 필요
✅ 통합 테스트 (UserSchedulerServiceTest)
정상 유저: 최근 로그인 시 삭제되지 않음
보호 유저: 로그인은 오래됐지만 최근 Pod 사용 기록이 있으면 삭제되지 않음
알림 발송: D-7, D-1 시점에 정확한 메시지(Slack/Email) 발송 검증
Soft Delete: isActive False 변경 및 deletedAt 기록 확인
Hard Delete: Soft Delete 1년 후 DB에서 데이터 삭제 확인
메시지 문구: messages.properties에 추가된 문구들이 적절한지 확인해 주세요.