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

Add ability to check health of redis when url is non-standard redis url #65

Closed archanasingh closed 6 years ago

archanasingh commented 7 years ago

A non standard url is being used for a rails project I'm working on redis://localhost:16379/0. But the gem only checks for the url redis://localhost:6379/0 (Note: ports are different). This pull request will allow to configure redis_url in the config but defaults to the standard url.

ouranos commented 6 years ago

This actually introduces a regression in 2.7.0

From the redis gem:

By default, the client will try to read the REDIS_URL environment variable and use that as URL to connect to.

All our projects are using non standard redis URL configured via REDIS_URL (which is also picked up by sidekiq). Since the upgrade to 2.7.0, the healtchecks are failing as HealthCheck.redis_url is defaulting to localhost.

I don't think this change is needed as you can address #63 by specifying REDIS_URL. If you'd like to keep it, it should default to ENV['REDIS_URL'] (I've opened a PR for it #70)