-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[NAYB-109] refactor: 회원의 등급 업데이트 로직 리팩토링
[NAYB-109] refactor: 회원의 등급 업데이트 로직 리팩토링
- Loading branch information
Showing
5 changed files
with
39 additions
and
43 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
24 changes: 24 additions & 0 deletions
24
src/main/java/com/prgrms/nabmart/domain/user/scheduler/GradeScheduler.java
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
package com.prgrms.nabmart.domain.user.scheduler; | ||
|
||
import com.prgrms.nabmart.domain.user.service.GradeService; | ||
import lombok.RequiredArgsConstructor; | ||
import net.javacrumbs.shedlock.spring.annotation.EnableSchedulerLock; | ||
import net.javacrumbs.shedlock.spring.annotation.SchedulerLock; | ||
import org.springframework.scheduling.annotation.Async; | ||
import org.springframework.scheduling.annotation.Scheduled; | ||
import org.springframework.stereotype.Component; | ||
|
||
@Component | ||
@RequiredArgsConstructor | ||
@EnableSchedulerLock(defaultLockAtMostFor = "PT60S") | ||
public class GradeScheduler { | ||
|
||
private final GradeService gradeService; | ||
|
||
@Async | ||
@Scheduled(cron = "0 0 5 1 * *") | ||
@SchedulerLock(name = "Update_User_Grade", lockAtLeastFor = "PT10S") | ||
public void updateUserGradeScheduler() { | ||
gradeService.updateUserGrade(); | ||
} | ||
} |
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
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
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