Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix aioredis Version Crash #661

Merged
merged 2 commits into from
Oct 24, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions newrelic/hooks/datastore_aioredis.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@
import aioredis

try:
AIOREDIS_VERSION = tuple(int(x) for x in getattr(aioredis, "__version__").split("."))
AIOREDIS_VERSION = lambda: tuple(int(x) for x in getattr(aioredis, "__version__").split("."))
except Exception:
AIOREDIS_VERSION = (0, 0, 0)
AIOREDIS_VERSION = lambda: (0, 0, 0)


def _conn_attrs_to_dict(connection):
Expand Down Expand Up @@ -68,7 +68,7 @@ def _nr_wrapper_AioRedis_method_(wrapped, instance, args, kwargs):
# Check for transaction and return early if found.
# Method will return synchronously without executing,
# it will be added to the command stack and run later.
if AIOREDIS_VERSION < (2,):
if AIOREDIS_VERSION() < (2,):
# AioRedis v1 uses a RedisBuffer instead of a real connection for queueing up pipeline commands
from aioredis.commands.transaction import _RedisBuffer
if isinstance(instance._pool_or_conn, _RedisBuffer):
Expand Down