I'm working with sidekiq and redis. I'm trying to find out and debug some issues but for that, I'd like to know what URL sidekiq is connecting to. I know i can check it in the file where i set my server and client, but is there a function I can use ala Resque.redis
that will show what redis instance sidekiq is connected to?
How can I check what redis port and instance sidekiq is connected to?
The URL info is shown at the bottom of the Web UI. Or you can use this code snippet:
Sidekiq.redis { |c| p c.client.location }
That's exactly what I was looking for! Thank you so much Mike. I knew the url was display on the web, but I didn't wanna have to go through the web panel each time. –
Misdeal
Does this guarantee that my Rails is success connected to redis? –
Cothurnus
Sidekiq 7.1.1:
Sidekiq.redis {|r| puts r.config.server_url }
–
Gametangium With recent versions of Sidekiq, you need to use:
Sidekiq.redis { |conn| p conn.connection[:location] }
If you want to get the hash with more information:
Sidekiq.redis { |conn| p conn.connection }
i believe this doesn't produce a URL with the password though –
Charlenacharlene
This seems to work, clearly not intended to be a public API.
Sidekiq.redis{ |conn| conn }._client.options[:url]
© 2022 - 2024 — McMap. All rights reserved.