Skip to content

Commit

Permalink
Add default_cache_expiration to OlpClientSettings (#834)
Browse files Browse the repository at this point in the history
This value is propagated to cache when something is stored by client.

Resolves: OLPEDGE-1914

Signed-off-by: Mykhailo Kuchma <[email protected]>
  • Loading branch information
mykhailo-kuchma authored May 14, 2020
1 parent 311adc8 commit 4b2c2e9
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions olp-cpp-sdk-core/include/olp/core/client/OlpClientSettings.h
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,20 @@ struct CORE_API OlpClientSettings {
* To only use the memory LRU cache with limited size, set to `nullptr`.
*/
std::shared_ptr<cache::KeyValueCache> cache = nullptr;

/**
* @brief Set default expiration for any cache entry made by the according
* layer or catalog client.
*
* This setting only applies to the mutable cache and to the in-memory cache,
* but should not affect the protected cache as no entries are added to the
* protected cache in read-only mode. Set to std::chrono::seconds::max() to
* disable expiration. By default expiration is disabled.
*
* @note This only makes sense for data that has an expiration limit, e.g.
* volatile or versioned, and which is stored in cache.
*/
std::chrono::seconds default_cache_expiration = std::chrono::seconds::max();
};

} // namespace client
Expand Down

0 comments on commit 4b2c2e9

Please sign in to comment.