Closed nathan-io closed 1 year ago
Setting the value via the intended API-s (ienova_set_setting_value()
or NovaSettings::setSettingValue()
) will force the cache to update. Additionally, the whole cache is dumped when the Settings' model's updating
event is fired.
However, if one were to saveQuietly() or directly ->update() a Setting model, they would need to clear the in-memory cache manually using NovaSettings::getStore()->clearCache()
.
@Tarpsvo I don't understand... I'm changing the value in Nova, via a nova-settings field for attribute some_key
. Doesn't that use the API as intended?
Hi @Tarpsvo could you reopen this? Unless I'm misunderstanding something, the response does not address the issue.
If a user changes a settings value in Nova, via a nova-settings field, does this not use the API and update the cache?
Hi @Tarpsvo wanted to follow up on this. I don't believe your response addresses the issue. If a user changes a settings value in Nova, via a nova-settings field, does this not use the API and update the cache?
I've also noticed that our queued jobs continue to use stale settings values, until we run horizon:terminate
.
Thanks for this package, we've used in several projects!
Today I noticed a strange behavior that seems to be related to the internal cache used by
NovaSettingsStore
.When in Tinker, if I change a setting through the web UI, the change isn't reflected by
nova_get_setting()
until I exit and restart Tinker.Then I change the value to "test2" in Nova and save. Then from the same Tinker session:
I'm not quite sure how this cache works, but am assuming that it starts as empty on each new request, so we wouldn't need to worry about a stale value on any subsequent request.
What I'm wondering is if this behavior could also happen if a value is changed at some point while processing a request, and then we reference it again before returning the response on that same request?
For example, if we have some API route which we want to have change the value of some nova-setting, and include that new value of the setting in the response body.