Skip to content

Commit

Permalink
fiat: added cashing returned result from findByEmail method
Browse files Browse the repository at this point in the history
  • Loading branch information
Troha7 committed Jan 17, 2024
1 parent 7393232 commit c184f68
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -45,6 +46,7 @@ public Contact create(ContactRequestDto contactRequestDto) {
}

@Override
@Cacheable("contacts")
public Contact findByEmail(String email) {
log.trace("Started findByEmail: {}", email);
return contactRepository
Expand Down

0 comments on commit c184f68

Please sign in to comment.