Skip to content

Commit

Permalink
chore: update
Browse files Browse the repository at this point in the history
  • Loading branch information
Kang1221 committed Aug 30, 2024
2 parents 664aedd + c152a4c commit 9c0ed3f
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/main/java/co/orange/ddanzi/service/SchedulerService.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
package co.orange.ddanzi.service;

import jakarta.transaction.Transactional;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Service;

@Slf4j
@Service
public class SchedulerService {

@Autowired
ItemService itemService;


/**
* 매일 자정마다 만료된 아이템 체크.
* 아이템 상태변경 & 재고 수 변경
**/
@Scheduled(cron = "0 10 0 * * ?")
@Transactional
@Scheduled(cron = "0 0 0 * * ?")
public void updateExpiredItems() {
log.info("Updating expired items");
itemService.updateExpiredItems();
}
}

0 comments on commit 9c0ed3f

Please sign in to comment.