settingslogic
settingslogic copied to clipboard
Variable is not updated when YML file changes, even when I use reload!
Immediately after updating the YML file I call upon the reload! function to make sure the variable I use to read the YML file values are also updated. But the variable is not being reflected fast enough. I am forced to call upon reload! function every time I use the variable just to make sure the correct value is being read. This causes a horrible performance issue since it unnecessarily loads the YML file over and over again.
Can your issue be related to Spring? I can reproduce it like this:
Initially I set AppConfig.test to be 1.
I then go into the console and AppConfig.test
would return 1.
Then I change it to 2.
When I go into the console, AppConfig.test
still returns 1.
Only after a AppConfig.reload!
call would AppConfig.test
return 2.
And if I exit the console again and start another console, it would still return 1 (unless I do another reload!
.
Calling spring stop
can remedy this issue, as the console would not cache the old value after that.
Same here. I would see the new variables in production console, but not a new development console.
spring stop
worked