Skip to content

Commit

Permalink
Slette cache for malBestilling naar dette skjer ved ordinaer bestilling
Browse files Browse the repository at this point in the history
  • Loading branch information
krharum committed Apr 19, 2024
1 parent 1333bec commit 2f2ceb2
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
import no.nav.testnav.libs.servletsecurity.action.GetUserInfo;
import org.apache.commons.collections4.IterableUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.cache.CacheManager;
import org.springframework.http.HttpStatus;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
Expand All @@ -33,6 +34,7 @@

import static java.util.Objects.isNull;
import static java.util.Objects.nonNull;
import static no.nav.dolly.config.CachingConfig.CACHE_BESTILLING_MAL;
import static no.nav.dolly.util.CurrentAuthentication.getUserId;

@Service
Expand All @@ -49,6 +51,7 @@ public class MalBestillingService {
private final MapperFacade mapperFacade;
private final GetUserInfo getUserInfo;
private final ObjectMapper objectMapper;
private final CacheManager cacheManager;

@Transactional(readOnly = true)
public RsMalBestillingWrapper getMalBestillinger() {
Expand Down Expand Up @@ -138,6 +141,8 @@ public void saveBestillingMal(Bestilling bestilling, String malNavn, Bruker bruk
oppdateEksisterende.setBestKriterier(bestilling.getBestKriterier());
oppdateEksisterende.setMiljoer(bestilling.getMiljoer());
}

cacheManager.getCache(CACHE_BESTILLING_MAL).clear();
}

@Transactional
Expand Down

0 comments on commit 2f2ceb2

Please sign in to comment.