Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chore : 스케줄러 코드 수정, 로그 레벨 추가 #60

Merged
merged 1 commit into from
Sep 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ public class SchedulerServiceImpl implements SchedulerService{
private final PhotoRepository photoRepository;
private final UuidRepository uuidRepository;
private final AmazonS3Manager s3Manager;
@Scheduled(cron = "0 0 6 * * ?", zone = "Asia/Seoul")
@Scheduled(cron = "*/10 * * * * *", zone = "Asia/Seoul")
@Transactional
public void deletePhoto() {
log.info("Scheduled task started for deleting photos");
log.info("deletePhoto () : call");
List<Photo> photoList = photoRepository.findAll();
photoList.stream()
.filter(photo -> Duration.between(photo.getCreatedAt(), LocalDateTime.now()).toMinutes() >= 1)
Expand Down
8 changes: 7 additions & 1 deletion src/main/resources/application-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ spring:
max-file-size: 20MB
max-request-size: 20MB

logging:
level:
root: INFO
org.springframework.web: DEBUG
org.springframework.scheduling: DEBUG
org.apache.coyote: DEBUG

cloud:
aws:
s3:
Expand All @@ -31,7 +38,6 @@ cloud:
static: ap-northeast-2
stack:
auto: false
cron: "0 * * * * *"
credentials:
accessKey: ${aws.access.key.id}
secretKey: ${aws.secret.access.key}
Expand Down
Loading