mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-28 19:58:11 +08:00
feat: make blob storage size threshold configurable (#16806)
### Summary - Make `BLOB_STORAGE_SIZE_THRESHOLD` configurable through an environment variable. - Preserve the existing 20 MiB default. - Add tests for the default and configured values. ### Why Blob storage, Seafile, and WebDAV connectors currently use a hardcoded 20 MiB limit. Self-hosted users cannot raise this limit without modifying the source code inside the container. ### Testing - `test/unit_test/data_source/test_config.py`: 2 passed - `ruff check common/data_source/config.py test/unit_test/data_source/test_config.py` Fixes #16634
This commit is contained in:
@@ -114,7 +114,10 @@ _PAGE_EXPANSION_FIELDS = [
|
||||
|
||||
|
||||
# Configuration constants
|
||||
BLOB_STORAGE_SIZE_THRESHOLD = 20 * 1024 * 1024 # 20MB
|
||||
try:
|
||||
BLOB_STORAGE_SIZE_THRESHOLD = int(os.environ.get("BLOB_STORAGE_SIZE_THRESHOLD", 20 * 1024 * 1024))
|
||||
except ValueError as error:
|
||||
raise ValueError("BLOB_STORAGE_SIZE_THRESHOLD must be an integer number of bytes") from error
|
||||
INDEX_BATCH_SIZE = 2
|
||||
SLACK_NUM_THREADS = 4
|
||||
ENABLE_EXPENSIVE_EXPERT_CALLS = False
|
||||
|
||||
Reference in New Issue
Block a user