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

Allow for configuration of redis connection via URL #6

Closed
lukemelia opened this issue Mar 20, 2015 · 6 comments · Fixed by #20
Closed

Allow for configuration of redis connection via URL #6

lukemelia opened this issue Mar 20, 2015 · 6 comments · Fixed by #20

Comments

@lukemelia
Copy link

We should be able to provide a URL in configuration connection to redis. It is supported by then-redis, so it shouldn't be too much work to support it in this library. Developers commonly have connection info available as a URL (from an env var, for example), and they shouldn't have to write code to parse it out.

@LevelbossMike
Copy link
Owner

This is actually already supported but not documented. You just have to pass the url as a string instead of a configuration object to the store property of the respective environment.

@jamesdixon
Copy link

Just to confirm, you pass the connection string directly to store? Also, what is the format of the connection string that's accepted? I've tried a few different versions with no success. Thank you!

@backspace
Copy link

I tried this: production: {store: 'redis://…'} and it worked, though it produced this error:

Unhandled rejection Error: ERR invalid DB index

@lukemelia
Copy link
Author

@backspace I believe that error is from how then-redis parses the url. Some redis providers include dummy username (after the // and before the :) that you will want to remove or replace with a numeric database index.

@backspace
Copy link

Ah, thanks. With just redis://password@host:port it failed totally, but it worked with redis://0:password@host:port. I can make a PR to update the README, but I’m new to Redis and don’t understand the implications of specifying a database index like that. When I used a configuration object with its host, port, and password, I didn’t specify an index; was it just choosing 0 by default?

@backspace
Copy link

Never mind, I see that it does choose 0 by default.

backspace added a commit to backspace/ember-deploy-redis that referenced this issue Jul 9, 2015
backspace added a commit to backspace/ember-deploy-redis that referenced this issue Jul 9, 2015
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 a pull request may close this issue.

4 participants