fix(backend/async_events): allow user to configure username for Redis authentication in GLOBAL_ASYNC_QUERIES_CACHE_BACKEND (#32372)

Signed-off-by: hainenber <dotronghai96@gmail.com>
Co-authored-by: Ville Brofeldt <33317356+villebro@users.noreply.github.com>
(cherry picked from commit e0ed652ed8)
This commit is contained in:
Đỗ Trọng Hải
2025-03-28 09:39:05 +07:00
committed by Michael S. Molina
parent 2c6cdfe7ad
commit 56f6e1196c

View File

@@ -95,6 +95,11 @@ class RedisCacheBackend(RedisCache):
"ssl_cert_reqs": config.get("CACHE_REDIS_SSL_CERT_REQS", "required"),
"ssl_ca_certs": config.get("CACHE_REDIS_SSL_CA_CERTS", None),
}
# Handle username separately as it's optional for Redis authentication.
if configured_username := config.get("CACHE_REDIS_USER"):
kwargs["username"] = configured_username
return cls(**kwargs)