Skip to content

Commit

Permalink
[feat] 스케줄링 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
hysong4u committed Feb 17, 2024
1 parent e3ed722 commit 8b7a903
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/main/java/com/example/comma/CommaApplication.java
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.scheduling.annotation.EnableScheduling;

@EnableScheduling
@SpringBootApplication()
public class CommaApplication {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,12 @@ public void createCard(Long userId, Long cardId) {
}

@Transactional
@Scheduled(cron = "10 * * * * *")
@Scheduled(cron = "0 0 0 * * ?")
public void resetCardRegistration() {
userCardRepository.findAll().forEach(userCard -> {
userCard.setQuizParticipation(false);
userCard.setCardRegistration(false);
userCardRepository.save(userCard);
System.out.println("userCard = " + userCard);
});
}

Expand Down

0 comments on commit 8b7a903

Please sign in to comment.