Don't repeat the logic from Default impl (#10813)
This commit is contained in:
parent
8fc504eb1a
commit
bd9a8aa22b
@ -933,13 +933,13 @@ impl Configuration {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn snapshot_config(&self) -> Result<SnapshotConfiguration, String> {
|
fn snapshot_config(&self) -> Result<SnapshotConfiguration, String> {
|
||||||
let conf = SnapshotConfiguration {
|
let mut conf = SnapshotConfiguration::default();
|
||||||
no_periodic: self.args.flag_no_periodic_snapshot,
|
conf.no_periodic = self.args.flag_no_periodic_snapshot;
|
||||||
processing_threads: match self.args.arg_snapshot_threads {
|
if let Some(threads) = self.args.arg_snapshot_threads {
|
||||||
Some(threads) if threads > 0 => threads,
|
if threads > 0 {
|
||||||
_ => ::std::cmp::max(1, num_cpus::get_physical() / 2),
|
conf.processing_threads = threads;
|
||||||
},
|
}
|
||||||
};
|
}
|
||||||
|
|
||||||
Ok(conf)
|
Ok(conf)
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user