Skip to content

Commit

Permalink
Remove redis_instance from options to avoid TypError for redis 3.x
Browse files Browse the repository at this point in the history
  • Loading branch information
TonyCTHsu committed Nov 14, 2022
1 parent a39c4c1 commit 48de53c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
5 changes: 1 addition & 4 deletions lib/datadog/tracing/contrib/redis/instrumentation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,7 @@ def get_pipeline_commands(args)
end

def datadog_configuration
# attribute reader `options` would works for Redis 4.x
# But Redis 3.x raises `TypeError: singleton can't be dumped`
# since overwritten with `Marshal.load(Marshal.dump(@options))`
Datadog.configuration.tracing[:redis, @options]
Datadog.configuration.tracing[:redis, options]
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/datadog/tracing/contrib/redis/patcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def self.included(base)
# Instance method patch for redis client
module InstanceMethods
def initialize(options = {})
@redis_instance = options[:redis_instance]
@redis_instance = options.delete(:redis_instance)

super(options)
end
Expand Down

0 comments on commit 48de53c

Please sign in to comment.