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

Add persistent settings #4751

Merged
merged 2 commits into from
Oct 23, 2022
Merged

Add persistent settings #4751

merged 2 commits into from
Oct 23, 2022

Conversation

andig
Copy link
Member

@andig andig commented Oct 7, 2022

This PR adds a simple interface for storing/retrieving settings from database. Settings provide additional abstractor over the plain db.Instance.

Settings are only saved when settings.Persist() is called. A corresponding shutdown hook is registered during setup.

store.Provider and store.Store provide abstraction for creating a store for a single value and load/save against that store. Using these, individual devices do not need to depend on the settings implementation. See #4838 for example usage.

@andig andig added the infrastructure Basic functionality label Oct 7, 2022
@andig andig marked this pull request as draft October 7, 2022 16:32
@andig andig force-pushed the feature/settings branch 5 times, most recently from 5fc8f57 to 6a12eb5 Compare October 14, 2022 11:14
@andig andig marked this pull request as ready for review October 16, 2022 08:19
@andig andig requested a review from naltatis October 16, 2022 08:19
@andig andig mentioned this pull request Oct 16, 2022
2 tasks
@andig andig merged commit 8c9918a into master Oct 23, 2022
@andig andig deleted the feature/settings branch October 23, 2022 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
infrastructure Basic functionality
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant