-
-
Notifications
You must be signed in to change notification settings - Fork 24
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 .env file on change without restarting the application #28
Conversation
This is good and I can think some actual use case, but you need to clear all variables from util.js to invalidate all config that read from envar. You can create a function in util.js to clear these. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a function to invalidate all config in util.js
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a function to invalidate all config in util.js
I have added a clearConfig() function, but I'm not 100% sure if this is what you meant. If this isn't what you had in mind, could you please clarify what you mean exactly? Thanks! |
This is correct. Because all reads from process.env are cached. Because it's set null all variables will be forced to be reset again in each util function. |
Can you try solve merge conflict before I approve this? |
Absolutely! I'm just going to wait to resolve the merge conflict until MR29 is merged as well. Otherwise, I'll end up with another merge conflict there later :) |
I think the branch is up-to-date now, all merge conflicts are solved. |
With this update, the application now automatically reloads environment variables from the .env file whenever changes are made. This eliminates the need to restart the application when updating an environment variable.