Skip to content

Commit

Permalink
fix: fix determine_redis_provider test behaviour (#6176)
Browse files Browse the repository at this point in the history
Unit tests fails when a different REDIS_URL is defined since the provider
string `p` could be an empty string. This causes all RedisConnections to
use 127.0.0.1:6379 as the connection parameters.

Co-authored-by: Sylvester Chin <schin@gitlab.com>
  • Loading branch information
slai11 and Sylvester Chin committed Jan 29, 2024
1 parent 501c39a commit f367138
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/sidekiq/redis_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ def determine_redis_provider
EOM
end

ENV[
p || "REDIS_URL"
]
ENV[p.to_s] || ENV["REDIS_URL"]
end
end
end
Expand Down

0 comments on commit f367138

Please sign in to comment.