7#include <unordered_map>
9#include <userver/cache/update_type.hpp>
10#include <userver/dynamic_config/snapshot.hpp>
11#include <userver/formats/json_fwd.hpp>
12#include <userver/yaml_config/fwd.hpp>
14USERVER_NAMESPACE_BEGIN
24 using std::logic_error::logic_error;
27enum class FirstUpdateMode {
34 formats::
parse::
To<FirstUpdateMode>);
36std::string_view ToString(FirstUpdateMode);
38enum class FirstUpdateType {
41 kIncrementalThenAsyncFull,
45 formats::
parse::
To<FirstUpdateType>);
47std::string_view ToString(FirstUpdateType);
49struct ConfigPatch
final {
50 std::chrono::milliseconds update_interval;
51 std::chrono::milliseconds update_jitter;
52 std::chrono::milliseconds full_update_interval;
53 std::optional<std::chrono::milliseconds> exception_interval;
57ConfigPatch Parse(
const formats::
json::Value& value,
58 formats::
parse::
To<ConfigPatch>);
62 const std::optional<
dump::Config>& dump_config);
64 Config MergeWith(
const ConfigPatch& patch)
const;
67 bool allow_first_update_failure;
68 std::optional<
bool> force_periodic_update;
69 bool config_updates_enabled;
70 bool has_pre_assign_check;
71 std::optional<std::string> task_processor_name;
72 std::chrono::milliseconds cleanup_interval;
73 bool is_strong_period;
74 std::optional<std::uint64_t> failed_updates_before_expiration;
76 FirstUpdateMode first_update_mode;
77 FirstUpdateType first_update_type;
79 std::chrono::milliseconds update_interval;
80 std::chrono::milliseconds update_jitter;
81 std::chrono::milliseconds full_update_interval;
82 std::optional<std::chrono::milliseconds> exception_interval;
86std::unordered_map<std::string, ConfigPatch> ParseCacheConfigSet(
87 const dynamic_config::DocsMap& docs_map);
89inline constexpr dynamic_config::Key<ParseCacheConfigSet> kCacheConfigSet;