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

reload without restart server #176

Closed
arthurtalkgoal opened this Issue Mar 14, 2015 · 3 comments

Comments

Projects
None yet
3 participants
@arthurtalkgoal

arthurtalkgoal commented Mar 14, 2015

hi i am using dotenv in my rails in unicorn.

I wonder is there anyway to reload my dotenv without restarting unicorn

@bkeepers

This comment has been minimized.

Show comment
Hide comment
@bkeepers

bkeepers Mar 16, 2015

Owner

There is not. I'd be happy to accept a simple patch that adds support for it, but it's not something I intend to implement. Note that you can reload the values yourself by calling Dotenv.overload("path/to/.env") in your application's initialization process.

One of the reasons I don't advocate for using dotenv in production is because it loads the environment variables within the ruby process, which makes it very difficult to track which variables were previously set and which were loaded by dotenv. If you set these variables in the environment of your server (/etc/environment, /etc/profile, etc) then unicorn reloading will just work.

Owner

bkeepers commented Mar 16, 2015

There is not. I'd be happy to accept a simple patch that adds support for it, but it's not something I intend to implement. Note that you can reload the values yourself by calling Dotenv.overload("path/to/.env") in your application's initialization process.

One of the reasons I don't advocate for using dotenv in production is because it loads the environment variables within the ruby process, which makes it very difficult to track which variables were previously set and which were loaded by dotenv. If you set these variables in the environment of your server (/etc/environment, /etc/profile, etc) then unicorn reloading will just work.

@bkeepers bkeepers closed this Mar 16, 2015

@jdowning

This comment has been minimized.

Show comment
Hide comment
@jdowning

jdowning Aug 11, 2015

@arthurtalkgoal Hello! I resolved this with this change to config/unicorn.rb.

jdowning commented Aug 11, 2015

@arthurtalkgoal Hello! I resolved this with this change to config/unicorn.rb.

@arthurtalkgoal

This comment has been minimized.

Show comment
Hide comment
@arthurtalkgoal

arthurtalkgoal Aug 23, 2015

Hi @justindowning , wow, that is smart!

arthurtalkgoal commented Aug 23, 2015

Hi @justindowning , wow, that is smart!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment