-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
6 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); | ||
} | ||
} |