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

Spring caches config value #9

Open
lulalala opened this issue Sep 8, 2015 · 1 comment
Open

Spring caches config value #9

lulalala opened this issue Sep 8, 2015 · 1 comment

Comments

@lulalala
Copy link

lulalala commented Sep 8, 2015

Step to reproduce:

Initially Config.test is set to 1.
I go into the console and Config.test would return 1.
Exit the console.

Then I change it to 2 in YAML.
When I start the console again, Config.test still returns 1.
Only after a Config.reload! call would Config.test return 2.

*** Up until here I can understand. What I consider strange is the below:

Even after a Config.reload!, the new value would only stay until I close the console
And if I exit the console again and start another console, it would still return 1.
Calling spring stop can remedy this issue, as the console would not cache the old value after that.
I would expect that given I have called reload!, the new value should be available in the Spring copy of memory.

@OtherCroissant
Copy link

Seems like I discovered the same behaviour. For tests, I performed the resetting with:
Object.send(:remove_const, 'Config')
load 'config.rb'

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