diff --git a/ddtrace/contrib/redis_utils.py b/ddtrace/contrib/redis_utils.py index b6e8623333f..fe9320d15be 100644 --- a/ddtrace/contrib/redis_utils.py +++ b/ddtrace/contrib/redis_utils.py @@ -68,6 +68,7 @@ async def _run_redis_command_async(ctx: core.ExecutionContext, func, args, kwarg parsed_command = stringify_cache_args(args) redis_command = parsed_command.split(" ")[0] rowcount = None + result = None try: result = await func(*args, **kwargs) return result diff --git a/releasenotes/notes/redis-utils-fix-undefined-variable-6c7d2d5ffcd01b41.yaml b/releasenotes/notes/redis-utils-fix-undefined-variable-6c7d2d5ffcd01b41.yaml new file mode 100644 index 00000000000..f5032c366f5 --- /dev/null +++ b/releasenotes/notes/redis-utils-fix-undefined-variable-6c7d2d5ffcd01b41.yaml @@ -0,0 +1,3 @@ +fixes: + - | + redis: This fix resolves an issue in redis utils where a variable may not be declared within a try/catch \ No newline at end of file