diff --git a/src/main/java/com/sch/chekirout/ChekiroutApplication.java b/src/main/java/com/sch/chekirout/ChekiroutApplication.java index cf46bb0..c0286e2 100644 --- a/src/main/java/com/sch/chekirout/ChekiroutApplication.java +++ b/src/main/java/com/sch/chekirout/ChekiroutApplication.java @@ -3,9 +3,11 @@ import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.data.jpa.repository.config.EnableJpaAuditing; +import org.springframework.scheduling.annotation.EnableAsync; @EnableJpaAuditing @SpringBootApplication +@EnableAsync public class ChekiroutApplication { //브랜치 확인 diff --git a/src/main/java/com/sch/chekirout/email/service/EmailService.java b/src/main/java/com/sch/chekirout/email/service/EmailService.java index b3be03f..2c41c96 100644 --- a/src/main/java/com/sch/chekirout/email/service/EmailService.java +++ b/src/main/java/com/sch/chekirout/email/service/EmailService.java @@ -12,6 +12,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.mail.javamail.JavaMailSender; import org.springframework.mail.javamail.MimeMessageHelper; +import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,7 +28,8 @@ public class EmailService { private final EmailVerificationTokenRepository tokenRepository; private final UserRepository userRepository; - + + @Async public void sendVerificationEmail(String recipientEmail) { String token = generateEmailVerificationToken(recipientEmail);