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

Attempt to save settings on exit for all Things #59

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

rwb27
Copy link
Collaborator

@rwb27 rwb27 commented Dec 13, 2023

The thing_settings object is currently discarded when the server stops, unless it's been explicitly saved. We now attempt to save it.

Future versions may save it only if it's non-empty, which would be neater.

The intention was that `thing_settings` would be saved on
write - but this does not yet work. I now explicitly save to
disk when the server exits cleanly.
@rwb27 rwb27 force-pushed the persist-settings-to-disk branch from 4980b70 to aee61db Compare December 13, 2023 00:12
Copy link

codecov bot commented Dec 13, 2023

Codecov Report

Attention: 5 lines in your changes are missing coverage. Please review.

Comparison is base (e1b6ebf) 79.93% compared to head (aee61db) 79.79%.

Files Patch % Lines
src/labthings_fastapi/thing_server.py 44.44% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #59      +/-   ##
==========================================
- Coverage   79.93%   79.79%   -0.15%     
==========================================
  Files          28       28              
  Lines        1630     1638       +8     
==========================================
+ Hits         1303     1307       +4     
- Misses        327      331       +4     
Flag Coverage Δ
unittests 79.79% <44.44%> (-0.15%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rwb27
Copy link
Collaborator Author

rwb27 commented Dec 13, 2023

Testing will need to be added in a future MR, for settings more generally.

@rwb27 rwb27 merged commit 3e3ce52 into main Dec 13, 2023
4 of 5 checks passed
@rwb27 rwb27 deleted the persist-settings-to-disk branch December 13, 2023 00:33
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

Successfully merging this pull request may close these issues.

1 participant