fix(query): set global max_threads not work
@@ -102,9 +102,10 @@ impl Settings {
settings
};
- // Overwrite settings from conf.
+ // Overwrite settings from conf or global set.
{
// Set max threads.
+ if ret.get_max_threads()? == 0 {
let cpus = if conf.query.num_cpus == 0 {
num_cpus::get() as u64
} else {
@@ -112,6 +113,7 @@ impl Settings {
};
ret.set_max_threads(cpus)?;
}
+ }
Ok(ret)
}
