Change get_by_id batch size from 25 to 5 to reserve db connection resouces

This commit is contained in:
yangdx
2025-04-06 17:42:13 +08:00
parent 3a5a921fde
commit b45c5f9304
2 changed files with 4 additions and 4 deletions

View File

@@ -9,9 +9,9 @@ if not pm.is_installed("redis"):
pm.install("redis") pm.install("redis")
# aioredis is a depricated library, replaced with redis # aioredis is a depricated library, replaced with redis
from redis.asyncio import Redis, ConnectionPool from redis.asyncio import Redis, ConnectionPool # type: ignore
from redis.exceptions import RedisError, ConnectionError from redis.exceptions import RedisError, ConnectionError # type: ignore
from lightrag.utils import logger, compute_mdhash_id from lightrag.utils import logger
from lightrag.base import BaseKVStorage from lightrag.base import BaseKVStorage
import json import json

View File

@@ -1395,7 +1395,7 @@ async def _find_most_related_text_unit_from_entities(
tasks.append((c_id, index, this_edges)) tasks.append((c_id, index, this_edges))
# Process in batches of 25 tasks at a time to avoid overwhelming resources # Process in batches of 25 tasks at a time to avoid overwhelming resources
batch_size = 25 batch_size = 5
results = [] results = []
for i in range(0, len(tasks), batch_size): for i in range(0, len(tasks), batch_size):