Create temp threadpool with all CPUs in dump

This commit is contained in:
nnethercott 2025-04-27 00:51:26 +02:00
parent 9fd9fcb03e
commit 648b2876f6
6 changed files with 40 additions and 11 deletions

View file

@ -115,7 +115,8 @@ impl IndexScheduler {
let local_pool;
let indexer_config = self.index_mapper.indexer_config();
let pool = match &indexer_config.thread_pool {
let pool_guard = indexer_config.thread_pool.read().unwrap();
let pool = match &*pool_guard {
Some(pool) => pool,
None => {
local_pool = ThreadPoolNoAbortBuilder::new()
@ -268,7 +269,8 @@ impl IndexScheduler {
if task.error.is_none() {
let local_pool;
let indexer_config = self.index_mapper.indexer_config();
let pool = match &indexer_config.thread_pool {
let pool_guard = indexer_config.thread_pool.read().unwrap();
let pool = match &*pool_guard {
Some(pool) => pool,
None => {
local_pool = ThreadPoolNoAbortBuilder::new()
@ -431,7 +433,8 @@ impl IndexScheduler {
if !tasks.iter().all(|res| res.error.is_some()) {
let local_pool;
let indexer_config = self.index_mapper.indexer_config();
let pool = match &indexer_config.thread_pool {
let pool_guard = indexer_config.thread_pool.read().unwrap();
let pool = match &*pool_guard {
Some(pool) => pool,
None => {
local_pool = ThreadPoolNoAbortBuilder::new()