chore: incorporate review comments

This commit is contained in:
Abhishek Kumar 2026-07-20 21:57:21 +05:30
parent 656977d7cd
commit acce761917
2 changed files with 19 additions and 0 deletions

View file

@ -261,6 +261,7 @@ class ARIHangupStrategy(HangupStrategy):
(Redis ``ari:channel:{id}`` -> run_id -> ``initial_context``). Best-effort:
never blocks dograh's own hangup if the upstream call fails.
"""
redis = None
try:
import redis.asyncio as aioredis
@ -319,3 +320,9 @@ class ARIHangupStrategy(HangupStrategy):
)
except Exception as e:
logger.error(f"[ARI Hangup] external PBX terminate check failed: {e}")
finally:
if redis is not None:
try:
await redis.aclose()
except Exception as e:
logger.warning(f"[ARI Hangup] failed to close Redis client: {e}")