Make specific configuration overrides override global configuration overrides
This commit is contained in:
parent
ec7a92342a
commit
a12f68d78c
|
@ -372,8 +372,9 @@ ACTOR template <class Env>
|
|||
Future<Void> testGlobalSet() {
|
||||
state Env env("class-A");
|
||||
wait(env.setup());
|
||||
wait(set(env, "class-A"_sr, 1));
|
||||
wait(set(env, Optional<KeyRef>{}, 10));
|
||||
wait(set(env, Optional<KeyRef>{}, 1));
|
||||
env.check(1);
|
||||
wait(set(env, "class-A"_sr, 10));
|
||||
env.check(10);
|
||||
return Void();
|
||||
}
|
||||
|
|
|
@ -81,16 +81,19 @@ public:
|
|||
|
||||
template <class... KS>
|
||||
void update(KS&... knobCollections) const {
|
||||
// Apply global overrides
|
||||
const auto& knobToValue = configClassToKnobToValue.at({});
|
||||
for (const auto& [knobName, knobValue] : knobToValue) {
|
||||
updateSingleKnob(knobName, knobValue, knobCollections...);
|
||||
}
|
||||
|
||||
// Apply specific overrides
|
||||
for (const auto& configClass : configPath) {
|
||||
const auto& knobToValue = configClassToKnobToValue.at(configClass);
|
||||
for (const auto& [knobName, knobValue] : knobToValue) {
|
||||
updateSingleKnob(knobName, knobValue, knobCollections...);
|
||||
}
|
||||
}
|
||||
const auto& knobToValue = configClassToKnobToValue.at({});
|
||||
for (const auto& [knobName, knobValue] : knobToValue) {
|
||||
updateSingleKnob(knobName, knobValue, knobCollections...);
|
||||
}
|
||||
}
|
||||
|
||||
bool hasSameConfigPath(ConfigKnobOverrides const& other) const { return configPath == other.configPath; }
|
||||
|
|
Loading…
Reference in New Issue