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:
hyotaek kim
2026-07-10 22:36:12 +09:00
committed by GitHub
parent d291e4641d
commit 9b60870fd6
2 changed files with 77 additions and 1 deletions

View File

@@ -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