From c184f689fc29590c86e1f6feb1dd41c8eec356cb Mon Sep 17 00:00:00 2001 From: Dmytro Trotsenko Date: Thu, 18 Jan 2024 00:21:28 +0200 Subject: [PATCH] fiat: added cashing returned result from findByEmail method --- src/main/java/com/chat/yourway/service/ContactServiceImpl.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/chat/yourway/service/ContactServiceImpl.java b/src/main/java/com/chat/yourway/service/ContactServiceImpl.java index a57826a2..abcac2c0 100644 --- a/src/main/java/com/chat/yourway/service/ContactServiceImpl.java +++ b/src/main/java/com/chat/yourway/service/ContactServiceImpl.java @@ -10,6 +10,7 @@ import com.chat.yourway.service.interfaces.ContactService; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.cache.annotation.Cacheable; import org.springframework.security.core.userdetails.UserDetails; import org.springframework.security.crypto.password.PasswordEncoder; import org.springframework.stereotype.Service; @@ -45,6 +46,7 @@ public Contact create(ContactRequestDto contactRequestDto) { } @Override + @Cacheable("contacts") public Contact findByEmail(String email) { log.trace("Started findByEmail: {}", email); return contactRepository