Skip to content

Commit

Permalink
nrreddis-v9 bug fix: check host is empty
Browse files Browse the repository at this point in the history
fixes an nrreddis 9 bug that was caused by checking that a host was not equal to an empty string, rather than checking that it was equal to an empty string.

Co-authored-by: Guntur Akhmad <gunturaf@gmail.com>
  • Loading branch information
iamemilio and gunturaf committed Apr 3, 2023
1 parent 638f6cc commit fd4d9c5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion v3/integrations/nrredis-v9/nrredis.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ func NewHook(opts *redis.Options) redis.Hook {
return h
}
if host, port, err := net.SplitHostPort(opts.Addr); err == nil {
if host != "" {
if host == "" {
host = "localhost"
}
h.segment.Host = host
Expand Down

0 comments on commit fd4d9c5

Please sign in to comment.