Skip to content

Commit c79842d

Browse files
Fix the expiration of the latest version. (#1093)
The user provided default expiration is passed to the CatalogCacheRepository. Resolves: OLPEDGE-2360 Signed-off-by: Mykhailo Kuchma <[email protected]>
1 parent d3bcdbf commit c79842d

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

olp-cpp-sdk-dataservice-read/src/repositories/CatalogCacheRepository.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,6 @@
3636
namespace {
3737
constexpr auto kLogTag = "CatalogCacheRepository";
3838

39-
// Currently, we expire the catalog version after 5 minutes. Later we plan to
40-
// give the user the control when to expire it.
4139
constexpr auto kChronoSecondsMax = std::chrono::seconds::max();
4240
constexpr auto kTimetMax = std::numeric_limits<time_t>::max();
4341

olp-cpp-sdk-dataservice-read/src/repositories/CatalogRepository.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ CatalogResponse CatalogRepository::GetCatalog(
5555
const auto fetch_options = request.GetFetchOption();
5656
const auto catalog_str = catalog_.ToCatalogHRNString();
5757

58-
repository::CatalogCacheRepository repository{
59-
catalog_, settings_.cache, settings_.default_cache_expiration};
58+
repository::CatalogCacheRepository repository(
59+
catalog_, settings_.cache, settings_.default_cache_expiration);
6060

6161
if (fetch_options != OnlineOnly && fetch_options != CacheWithUpdate) {
6262
auto cached = repository.Get();
@@ -106,7 +106,8 @@ CatalogResponse CatalogRepository::GetCatalog(
106106

107107
CatalogVersionResponse CatalogRepository::GetLatestVersion(
108108
const CatalogVersionRequest& request, client::CancellationContext context) {
109-
repository::CatalogCacheRepository repository(catalog_, settings_.cache);
109+
repository::CatalogCacheRepository repository(
110+
catalog_, settings_.cache, settings_.default_cache_expiration);
110111

111112
const auto fetch_option = request.GetFetchOption();
112113
// in case if get version online was never called and version was not found in

0 commit comments

Comments
 (0)