Purple-Devs / health_check

Simple health check of Rails app for use with uptime checking sites like newrelic and pingdom
MIT License
476 stars 125 forks source link

Check for redis gem does not work #128

Open haffla opened 1 year ago

haffla commented 1 year ago

Hey!

Following up on #127 where I said that there is an issue about redis-client. Well the issue isn't really redis-client. The issue is that the case of redis not being installed isn't handled gracefully. The check unless defined?(::Redis) doesn't seem to work. It fails with "health_check failed: uninitialized constant #::Redis".

But I think that reveals another issue. The gem has this hidden dependency on the redis gem. In our project this error occurred when we upgraded Sidekiq to version 7. It doesn't ship with redis anymore but instead redis-client. So in order to fix this we need to add redis to our dependencies again. Now we have dependencies on two redis clients. Wouldn't it be nice if health_check wouldn't force you to install either, but rather use the one that is available? Or make it configurable. Just throwing ideas around.

What do you think?

P.S. I know about the sidekiq-redis check. I think this could still be an issue for people who don't use Sidekiq at all, just redis-client.