| 92 | |
| 93 | template <typename T> |
| 94 | T getConfig( |
| 95 | const std::unordered_map<std::string, std::string>& configs, |
| 96 | const std::string_view& key, |
| 97 | const T& defaultValue) { |
| 98 | if (configs.count(std::string(key)) > 0) { |
| 99 | try { |
| 100 | return folly::to<T>(configs.at(std::string(key))); |
| 101 | } catch (const std::exception& e) { |
| 102 | BOLT_USER_FAIL( |
| 103 | "Failed while parsing SharedArbitrator configs: {}", e.what()); |
| 104 | } |
| 105 | } |
| 106 | return defaultValue; |
| 107 | } |
| 108 | } // namespace |
| 109 | |
| 110 | int64_t SharedArbitrator::ExtraConfig::reservedCapacity( |
no test coverage detected