-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Support Sentinel for Redis connections #132
Comments
We use mockredis to, well, mock Redis in the tests. This is no longer maintained (and nor is the alternative they suggest using, fakeredis). Nor does it support mocking Sentinel. So if we want to add test coverage for this we'll need to take a wider look at this. With
Set |
An alternative to mocking would be to add redis and redis-sentinel services to the GitHub action, that would be simple enough to do. It would remove a dependency on the unsupported mockredis (although I did note that this has been forked by RedisLabs with recent commits) while making local testing more complex. |
This adds basic support for using Redis Sentinel to mediate connections to the primary Redis server used by the API functionality. Setting `REDIS_SENTINEL_HOSTS` to a dict of "'host': port" key/values will override any settings for `REDIS_DB_HOST` and `REDIS_DB_PORT` with values provided by Sentinel. Note that for the purposes of running tests, this will circumvent the patching of `api_keys.utils.redis.StrictRedis` by mockredis as calls to `redis_connection()` will use `sentinel.master_for` rather than `redis.StrictRedis`, so you'll need functioning Redis and Sentinel services in this case. Set `REDIS_SENTINEL_HOSTS` to `null` to fall-back to the existing mocked connection. Fixes #132
This adds basic support for using Redis Sentinel to mediate connections to the primary Redis server used by the API functionality. Setting `REDIS_SENTINEL_HOSTS` to a dict of "'host': port" key/values will override any settings for `REDIS_DB_HOST` and `REDIS_DB_PORT` with values provided by Sentinel. Fixes #132
This adds basic support for using Redis Sentinel to mediate connections to the primary Redis server used by the API functionality. Setting `REDIS_SENTINEL_HOSTS` to a dict of "'host': port" key/values will override any settings for `REDIS_DB_HOST` and `REDIS_DB_PORT` with values provided by Sentinel. Fixes #132
We need to be able to support using Sentinel to mediate Redis connections.
The text was updated successfully, but these errors were encountered: