Skip to content

Commit b201264

Browse files
committed
redis
1 parent e7dcb1f commit b201264

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

sentry_sdk/integrations/redis/redis_cluster.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,11 +36,14 @@ def _set_async_cluster_db_data(span, async_redis_cluster_instance):
3636
def _set_async_cluster_pipeline_db_data(span, async_redis_cluster_pipeline_instance):
3737
# type: (Span, AsyncClusterPipeline[Any]) -> None
3838
with capture_internal_exceptions():
39+
client = getattr(
40+
async_redis_cluster_pipeline_instance, "cluster_client", None
41+
) or getattr(async_redis_cluster_pipeline_instance, "_client", None)
3942
_set_async_cluster_db_data(
4043
span,
4144
# the AsyncClusterPipeline has always had a `_client` attr but it is private so potentially problematic and mypy
4245
# does not recognize it - see https://github.com/redis/redis-py/blame/v5.0.0/redis/asyncio/cluster.py#L1386
43-
async_redis_cluster_pipeline_instance._client, # type: ignore[attr-defined]
46+
client, # type: ignore[attr-defined]
4447
)
4548

4649

0 commit comments

Comments
 (0)