fix(redis): say when an async client drops an unusable connect func

A caller-supplied redis_connect_func has no way to run on an async
connection, so log it instead of dropping it in silence.
This commit is contained in:
mateo-berri 2026-08-20 15:53:00 -07:00
parent bfe54eb013
commit 307ca1bcc7

View file

@ -589,6 +589,12 @@ def _async_credential_provider(redis_connect_func: object | None) -> CredentialP
if azure_credential is not None:
return AzureADCredentialProvider(azure_credential, username=os.environ.get("REDIS_USERNAME") or None)
if redis_connect_func is not None:
verbose_logger.warning(
"REDIS: dropping redis_connect_func, which an async connection cannot run. "
"Configure Azure AD or GCP IAM auth so a credential provider handles the token instead."
)
return None