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

Default values #66

Closed
jlecour opened this issue Dec 2, 2014 · 3 comments
Closed

Default values #66

jlecour opened this issue Dec 2, 2014 · 3 comments

Comments

@jlecour
Copy link

jlecour commented Dec 2, 2014

Hi,

I've read the source code and tried a few feature toggles in one of my applications.

If I understand correctly, a feature is disabled by default. Am I right ?
If so, is there a good way to have it enabled by default ?

Thanks

@jlecour
Copy link
Author

jlecour commented Dec 2, 2014

I've added this in an initializer

unless $rollout.features.include?(:my_feature)
  $rollout.activate(:my_feature)
end

but it's a very bad idea.

Since version 3.0, the Redis client is not really opening the connection to the server until it's really needed. When checking for already set features, the connection is opened very early in the boot process.

If you use a forking web server (like Passenger or Unicorn) it is done before forking the workers who then inherit connection with shared resources.

It's possible to manually quit the Redis connections before fork (at least with Unicorn) and reopen them after fork, but it's tedious.

@jlecour
Copy link
Author

jlecour commented Feb 15, 2016

@reneklacan Hi, do you have some information about this ?
I've noticed that you've closed the issue and I'm curious if something has changed regarding this. Thanks.

@reneklacan
Copy link
Member

@jlecour Sorry for closing without any comment.

From your description it sounds like the best solution would be having disable_my_feature instead of my_feature and check for it in your code, that way it would be enabled by default. Modifying rollout code for this use case seems unnecessary.

What do you think?

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

2 participants