From c9fc72e0da28d7500254f5447e86b9835f1b1441 Mon Sep 17 00:00:00 2001 From: viacheslav_kolesnyk Date: Fri, 6 Dec 2024 10:01:01 +0100 Subject: [PATCH] fix(browse): Fix old browse config returned on get after upsert (#708) Closes: MSEARCH-897 (cherry picked from commit afc034ad7d6c64edac86658dcb2123c13ef6a675) --- NEWS.md | 1 + .../org/folio/search/service/config/BrowseConfigService.java | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS.md b/NEWS.md index c08b5edd1..042fbe70f 100644 --- a/NEWS.md +++ b/NEWS.md @@ -4,6 +4,7 @@ ### Bug fixes * Populate typeId and sourceId on subjects re-indexing ([MSEARCH-891](https://folio-org.atlassian.net/browse/MSEARCH-891)) +* Fix old browse config returned on get after upsert ([MSEARCH-897](https://folio-org.atlassian.net/browse/MSEARCH-897)) ### Dependencies * Bump `opensearch` from `2.17.1` to `2.18.0` fixing protobuf-java CVE-2024-7254 ([MSEARCH-889](https://folio-org.atlassian.net/browse/MSEARCH-889)) diff --git a/src/main/java/org/folio/search/service/config/BrowseConfigService.java b/src/main/java/org/folio/search/service/config/BrowseConfigService.java index 9cc631b2b..b15b7a323 100644 --- a/src/main/java/org/folio/search/service/config/BrowseConfigService.java +++ b/src/main/java/org/folio/search/service/config/BrowseConfigService.java @@ -58,8 +58,7 @@ public BrowseConfig getConfig(@NonNull BrowseType type, @NonNull BrowseOptionTyp "Config for %s type %s must be present in database".formatted(typeValue, optionTypeValue))); } - @CacheEvict(cacheNames = BROWSE_CONFIG_CACHE, - key = "@folioExecutionContext.tenantId + ':' + #type.value + ':' + #optionType.value") + @CacheEvict(cacheNames = BROWSE_CONFIG_CACHE, allEntries = true) public void upsertConfig(@NonNull BrowseType type, @NonNull BrowseOptionType optionType, @NonNull BrowseConfig config) {