Skip to content

Commit 4b2c2e9

Browse files
Add default_cache_expiration to OlpClientSettings (#834)
This value is propagated to cache when something is stored by client. Resolves: OLPEDGE-1914 Signed-off-by: Mykhailo Kuchma <[email protected]>
1 parent 311adc8 commit 4b2c2e9

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

olp-cpp-sdk-core/include/olp/core/client/OlpClientSettings.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,20 @@ struct CORE_API OlpClientSettings {
258258
* To only use the memory LRU cache with limited size, set to `nullptr`.
259259
*/
260260
std::shared_ptr<cache::KeyValueCache> cache = nullptr;
261+
262+
/**
263+
* @brief Set default expiration for any cache entry made by the according
264+
* layer or catalog client.
265+
*
266+
* This setting only applies to the mutable cache and to the in-memory cache,
267+
* but should not affect the protected cache as no entries are added to the
268+
* protected cache in read-only mode. Set to std::chrono::seconds::max() to
269+
* disable expiration. By default expiration is disabled.
270+
*
271+
* @note This only makes sense for data that has an expiration limit, e.g.
272+
* volatile or versioned, and which is stored in cache.
273+
*/
274+
std::chrono::seconds default_cache_expiration = std::chrono::seconds::max();
261275
};
262276

263277
} // namespace client

0 commit comments

Comments
 (0)