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

Add database & password parameters support for predis sentinel #340

Merged
merged 3 commits into from
Jun 3, 2017

Conversation

Erliz
Copy link
Contributor

@Erliz Erliz commented May 4, 2017

If you use Sentinel you could not set db id in dsn like this redis://%redis_host%:%redis_port%/1 you will have an exception:

[Predis\ClientException]
  No sentinel server available for autodiscovery.

cause this dsn is connection for sentinel hosts and it have no idea about database number.
For this reason predis add additional parameters to connection options
in this issue predis/predis#131 (comment)
by this commit predis/predis@a816adf

After a day of debugging this bundle and predis i found this magic method setDefaultParameters and it's work like a charm for me.

i think it will be relative for
#274
#315
#339
#336

@MyDigitalLife
Copy link

It would be nice to also update the documentation in Resources/doc/index.md to reflect that these options have been added.

@Erliz
Copy link
Contributor Author

Erliz commented May 16, 2017

I already add it doc_update

@Erliz
Copy link
Contributor Author

Erliz commented May 16, 2017

After sentinel return connection to master/slave there is no option to wrap NodeConnection with ConnectionWrapper, i add it similarly by sentinel connection.

@MyDigitalLife
Copy link

Sorry, didn't see that. Nice job.

@Crozin
Copy link

Crozin commented Jun 2, 2017

Any chance for merge anytime soon?

```

The `service` is the name of the set of Redis instances.
The `parameters` is optional parameters that added to master/slave connections and ignores by sentinel connections.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you please change this to:

The optional parameters option can be used to set parameters like the database number and password for the master/slave connections, they don't apply for the connection to sentinal.

(if it sounds correct to you, I don't have sentinal experience)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Improved

@snc snc merged commit a2ffea7 into snc:master Jun 3, 2017
@snc
Copy link
Owner

snc commented Jun 3, 2017

Thanks, merged.

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

Successfully merging this pull request may close these issues.

4 participants