mirror of
https://github.com/GreptimeTeam/greptimedb.git
synced 2026-05-17 21:40:37 +00:00
fix: handle if num_cpus / 2 == 0 (#2740)
Signed-off-by: Ruihang Xia <waynestxia@gmail.com>
This commit is contained in:
@@ -92,7 +92,7 @@ impl MitoConfig {
|
||||
// Sanitize worker num.
|
||||
let num_workers_before = self.num_workers;
|
||||
if self.num_workers == 0 {
|
||||
self.num_workers = num_cpus::get() / 2;
|
||||
self.num_workers = (num_cpus::get() / 2).max(1);
|
||||
}
|
||||
if num_workers_before != self.num_workers {
|
||||
warn!(
|
||||
|
||||
Reference in New Issue
Block a user