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::chrono::milliseconds full_update_jitter;
54 std::optional<std::chrono::milliseconds> exception_interval;
56 std::uint64_t alert_on_failing_to_update_times;
59ConfigPatch Parse(
const formats::
json::Value& value,
60 formats::
parse::
To<ConfigPatch>);
64 const std::optional<
dump::Config>& dump_config);
66 Config MergeWith(
const ConfigPatch& patch)
const;
69 bool allow_first_update_failure;
70 std::optional<
bool> force_periodic_update;
71 bool config_updates_enabled;
72 bool has_pre_assign_check;
73 std::optional<std::string> task_processor_name;
74 std::chrono::milliseconds cleanup_interval;
75 bool is_strong_period;
76 std::optional<std::uint64_t> failed_updates_before_expiration;
78 FirstUpdateMode first_update_mode;
79 FirstUpdateType first_update_type;
81 std::chrono::milliseconds update_interval;
82 std::chrono::milliseconds update_jitter;
83 std::chrono::milliseconds full_update_interval;
84 std::chrono::milliseconds full_update_jitter;
85 std::optional<std::chrono::milliseconds> exception_interval;
87 std::uint64_t alert_on_failing_to_update_times;
90extern const dynamic_config::Key<std::unordered_map<std::string, ConfigPatch>>