Skip to content

Commit

Permalink
feat: change scheduler time method
Browse files Browse the repository at this point in the history
- 스케쥴링 시간 설정 방법 변경
- 스케쥴링 설정을 환경변수로 분리
  • Loading branch information
seokwns committed Jan 14, 2024
1 parent dab007d commit afdcadf
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .github/workflows/gradle-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ env:
REPORT_RECEIVER_EMAIL: ${{ secrets.REPORT_RECEIVER_EMAIL }}
REDIS_HOST: ${{ secrets.REDIS_HOST }}
IMAGE_CACHE_SIZE: ${{ secrets.IMAGE_CACHE_SIZE }}
IMAGE_CACHE_SCHEDULE: ${{ secrets.IMAGE_CACHE_SCHEDULE }}
IMAGE_CACHE_EXPIRE: ${{ secrets.IMAGE_CACHE_EXPIRE }}

jobs:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public ImageCachingScheduler(@Autowired ParsedImageService parsedImageService) {
this.parsedImageService = parsedImageService;
}

@Scheduled(fixedRate = 1000 * 60 * 10, zone = "Asia/Seoul")
@Scheduled(cron = "${api.image.cache-schedule}", zone = "Asia/Seoul")
public void imageCachingTaskSchedule() {
log.debug("[scheduler] 이미지 분석 캐시 데이터 rebase 시작");
parsedImageService.rebase();
Expand Down
1 change: 1 addition & 0 deletions see-realview/src/main/resources/properties/env.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ api:
receiver-email: ${REPORT_RECEIVER_EMAIL}
image:
cache-size: ${IMAGE_CACHE_SIZE}
cache-schedule: ${IMAGE_CACHE_SCHEDULE}
expire: ${IMAGE_CACHE_EXPIRE}

redis:
Expand Down

0 comments on commit afdcadf

Please sign in to comment.