AttachmentCleanupJob.java

역할


1. 필드

private final AttachmentRepository attachmentRepository; // DB 접근용
private final FileStorageService fileStorageService;     // 파일 시스템 접근용

@Value("${app.attachment-cleanup.enabled:true}")
private boolean enabled;                                   // 청소 기능 활성 여부

@Value("${app.attachment-cleanup.retention-days:1}")
private int retentionDays;                                 // soft delete 후 보관 일수

2. 메서드

@Scheduled(fixedDelay = 600000) // 10분마다 실행
@Transactional
public void cleanupDeletedAttachments() { ... }

3. 특징