fix feedback

This commit is contained in:
EndlessLucky 2026-04-07 04:45:13 -04:00
parent 067d1d1578
commit da15884ce2
4 changed files with 4 additions and 4 deletions

View File

@ -530,7 +530,7 @@ LOG_FORMAT=%(asctime)s,%(msecs)d %(levelname)-2s [%(filename)s:%(lineno)d] %(req
# Indexing configuration
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
# Maximum number of worker threads used for high-quality dataset indexing.
# Maximum number of worker threads used for high-quality dataset indexing (1-10).
# Lower this value to reduce memory usage and avoid OOM freezes during re-indexing.
INDEXING_MAX_WORKERS=2

View File

@ -1109,7 +1109,7 @@ class IndexingConfig(BaseSettings):
)
INDEXING_MAX_WORKERS: PositiveInt = Field(
description="Maximum number of worker threads used for high-quality dataset indexing",
description="Maximum number of worker threads used for high-quality dataset indexing (1-10)",
default=2,
)

View File

@ -604,7 +604,7 @@ class IndexingRunner:
# High-quality indexing is memory intensive (embedding generation + vector writes).
# Running too many chunks in parallel can trigger OOM and freeze the service until reboot.
max_workers = max(1, min(10, int(dify_config.INDEXING_MAX_WORKERS)))
max_workers = max(1, int(dify_config.INDEXING_MAX_WORKERS))
max_workers = min(max_workers, len(documents)) if documents else 1
if dataset.indexing_technique == IndexTechniqueType.HIGH_QUALITY:
with concurrent.futures.ThreadPoolExecutor(max_workers=max_workers) as executor:

View File

@ -1009,7 +1009,7 @@ SENDGRID_API_KEY=
# Maximum length of segmentation tokens for indexing
INDEXING_MAX_SEGMENTATION_TOKENS_LENGTH=4000
# Maximum number of worker threads used for high-quality dataset indexing.
# Maximum number of worker threads used for high-quality dataset indexing (1-10).
# Lower this value to reduce memory usage and avoid OOM/freezes during re-indexing.
INDEXING_MAX_WORKERS=2