From 508774b3bc3439f26c89012c5db2fdfb58c03543 Mon Sep 17 00:00:00 2001 From: malazalkoj Date: Tue, 25 Jun 2024 14:48:18 +0200 Subject: [PATCH] Use @cacheable for ereg_client. --- src/main/kotlin/no/nav/syfo/ereg/EregClient.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main/kotlin/no/nav/syfo/ereg/EregClient.kt b/src/main/kotlin/no/nav/syfo/ereg/EregClient.kt index c781697..d0022cc 100644 --- a/src/main/kotlin/no/nav/syfo/ereg/EregClient.kt +++ b/src/main/kotlin/no/nav/syfo/ereg/EregClient.kt @@ -8,6 +8,7 @@ import no.nav.syfo.util.NAV_CONSUMER_ID_HEADER import no.nav.syfo.util.createCallId import org.slf4j.LoggerFactory import org.springframework.beans.factory.annotation.Value +import org.springframework.cache.annotation.Cacheable import org.springframework.http.HttpEntity import org.springframework.http.HttpHeaders import org.springframework.http.HttpMethod @@ -42,11 +43,11 @@ class EregClient @Inject constructor( throw e } } - /*@Cacheable( - value = [CacheConfig.CACHENAME_EREG_VIRKSOMHETSNAVN], + @Cacheable( + value = ["ereg_virksomhetsnavn"], key = "#virksomhetsnummer", condition = "#virksomhetsnummer != null", - )*/ + ) fun virksomhetsnavn(virksomhetsnummer: String): String { return eregResponse(virksomhetsnummer).navn() }