Skip to content

Commit

Permalink
consolidate distribution configs under "routing_options" item in routing
Browse files Browse the repository at this point in the history
Summary: as title

Reviewed By: udippant

Differential Revision: D52839051

fbshipit-source-id: ec243b3edcd86bf37b36e2132d655a9a9a38c4d4
  • Loading branch information
Lenar Fatikhov authored and facebook-github-bot committed Jan 20, 2024
1 parent eb80082 commit 30b22ae
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions mcrouter/ProxyConfig-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,13 @@ ProxyConfig<RouterInfo>::ProxyConfig(
partialConfigs_ = provider.releasePartialConfigs();
}
accessPoints_ = provider.releaseAccessPoints();
auto readBool = [&](std::string_view key, bool defaultValue) {
if (auto* j = json.get_ptr(key)) {

auto jRoutingOptions = json.get_ptr("routing_options");
auto readBool = [&jRoutingOptions](std::string_view key, bool defaultValue) {
if (!jRoutingOptions) {
return defaultValue;
}
if (auto* j = jRoutingOptions->get_ptr(key)) {
return parseBool(*j, key);
}
return defaultValue;
Expand Down

0 comments on commit 30b22ae

Please sign in to comment.