File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -871,7 +871,7 @@ async def _async_quantize_vectors(
871871 checkpoint_path: Optional path for checkpoint file (enables resume)
872872
873873 Returns:
874- Number of documents processed
874+ Number of documents quantized
875875 """
876876 client = source_index ._redis_client
877877 if client is None :
Original file line number Diff line number Diff line change @@ -14,17 +14,23 @@ async def async_list_indexes(
1414 * , redis_url : Optional [str ] = None , redis_client : Optional [AsyncRedisClient ] = None
1515) -> List [str ]:
1616 """List all search indexes in Redis (async version)."""
17+ created_client = False
1718 if redis_client is None :
1819 if not redis_url :
1920 raise ValueError ("Must provide either redis_url or redis_client" )
2021 redis_client = await RedisConnectionFactory ._get_aredis_connection (
2122 redis_url = redis_url
2223 )
23- index = AsyncSearchIndex .from_dict (
24- {"index" : {"name" : "__redisvl_migration_helper__" }, "fields" : []},
25- redis_client = redis_client ,
26- )
27- return await index .listall ()
24+ created_client = True
25+ try :
26+ index = AsyncSearchIndex .from_dict (
27+ {"index" : {"name" : "__redisvl_migration_helper__" }, "fields" : []},
28+ redis_client = redis_client ,
29+ )
30+ return await index .listall ()
31+ finally :
32+ if created_client :
33+ await redis_client .aclose () # type: ignore[union-attr]
2834
2935
3036async def async_wait_for_index_ready (
You can’t perform that action at this time.
0 commit comments