Skip to content

Commit b8848af

Browse files
committed
fix: address codex review for PR3 (async)
- Fix SVS client leak in async_planner check_svs_requirements - Remove dead async_utils.py (functions duplicated in async_executor)
1 parent 02a60da commit b8848af

File tree

2 files changed

+5
-108
lines changed

2 files changed

+5
-108
lines changed

redisvl/migration/async_planner.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,13 +161,15 @@ async def _check_svs_vamana_requirements(
161161
return warnings
162162

163163
# Check Redis version support
164+
created_client = False
164165
try:
165166
if redis_client:
166167
client = redis_client
167168
elif redis_url:
168169
from redis.asyncio import Redis
169170

170171
client = Redis.from_url(redis_url)
172+
created_client = True
171173
else:
172174
client = None
173175

@@ -182,6 +184,9 @@ async def _check_svs_vamana_requirements(
182184
"SVS-VAMANA requires Redis >= 8.2.0 and Redis Search >= 2.8.10. "
183185
"Verify your Redis instance supports this algorithm before applying."
184186
)
187+
finally:
188+
if created_client and client is not None:
189+
await client.aclose() # type: ignore[union-attr]
185190

186191
# Intel hardware warning for compression
187192
if uses_compression:

redisvl/migration/async_utils.py

Lines changed: 0 additions & 108 deletions
This file was deleted.

0 commit comments

Comments
 (0)