From 9bbd36ba3a4e60e41d890d835978c84519cb1dc6 Mon Sep 17 00:00:00 2001 From: deepredk Date: Fri, 20 Oct 2023 20:46:12 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20@Transactional=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/it/numble/hittracker/service/HitTrackerService.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/it/numble/hittracker/service/HitTrackerService.java b/src/main/java/it/numble/hittracker/service/HitTrackerService.java index 28e3b68..a44270d 100644 --- a/src/main/java/it/numble/hittracker/service/HitTrackerService.java +++ b/src/main/java/it/numble/hittracker/service/HitTrackerService.java @@ -14,9 +14,11 @@ import lombok.RequiredArgsConstructor; import org.springframework.scheduling.annotation.Async; import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; @Service @RequiredArgsConstructor +@Transactional public class HitTrackerService { private final UrlRepository urlRepository; @@ -75,7 +77,7 @@ private void deleteOldDailyHitLogs(LocalDate today) { } @Async - private void track(String url) { + protected void track(String url) { Url urlBeingTracked = new Url(url); urlRepository.save(urlBeingTracked); }