Skip to content
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

Failure to define :sentinels option results in error when calling 'slaves' #56

Closed
phallstrom opened this issue Mar 3, 2015 · 0 comments

Comments

@phallstrom
Copy link

I realize this is an edge case, but in development I have no sentinels so left off the :sentinels option entirely. For kicks I then called slaves on my redis object and got this error:

NoMethodError: undefined method `shift' for nil:NilClass
from .../gems/redis-sentinel-1.5.0/lib/redis-sentinel/client.rb:56:in `try_next_sentinel'

From reading the source I think tweaking parse_sentinel_options to return an empty array if nothing is provided would fix it.

See: https://github.com/flyerhzm/redis-sentinel/blob/master/lib/redis-sentinel/client.rb#L201

I'm happy to make the change and add specs if you agree this is the right behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant