Skip to content

Commit

Permalink
Chore : 스케줄러 코드 수정, 로그 레벨 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hyeonda02 committed Sep 2, 2024
1 parent c890201 commit 79d3dd3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
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

0 comments on commit 79d3dd3

Please sign in to comment.