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

Upload NS status when possible. #1346

Merged

Conversation

tzachi-dar
Copy link
Contributor

Before this checkin, ns-loop created the status data, and uploaded it to nightscout (if possible).
But in case of failure, the file will get overwritten.
This means that in the case of no internet, OAPS decisions get lost.
This checkin fixes it by adding timestamps to the files.
When internet is available, the files will be uploaded according to the correct order.
Files older than a day will be deleted.

Testing:
I have prevented uploading of files for a few hours, and when it was enabled again, data was shown correctly in nightscout site.
Decreased timeout, and saw the files being deleted.

Signed-off-by: Tzachi Dar tzachi.dar@gmail.com

Before this checkin, ns-loop created the status data, and uploaded it to nightscout (if possible).
But in case of failure, the file will get overwritten.
This means that in the case of no internet, OAPS decisions get lost.
This checkin fixes it by adding timestamps to the files.
When internet is available, the files will be uploaded according to the correct order.
Files older than a day will be deleted.

Testing:
I have prevented uploading of files for a few hours, and when it was enabled again, data was shown correctly in nightscout site.
Decreased timeout, and saw the files being deleted.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
@sulkaharo
Copy link
Collaborator

😍 How typical is it currently for the upload skipping to happen? Wondering about the impact on the amount of data sent to Nightscout, as this could impact the NS performance on many levels

@tzachi-dar
Copy link
Contributor Author

I guess that it depends on your network. Our rigs that are at home never miss an upload, and the one that are at school miss a few hours every week.
Probably there are people who don't have internet at day, and connect only at night, and for them there will be some load at night once they connect.
That said, In my experiment, data of a whole day was loaded in 5-10 minutes, and I did not notice any issue with NS.

… of uploading it.

Signed-off-by: Tzachi Dar <tzachi.dar@gmail.com>
@tzachi-dar
Copy link
Contributor Author

Please note that I have added another commit to this pr.

@scottleibrand scottleibrand mentioned this pull request Feb 3, 2020
@scottleibrand
Copy link
Contributor

Tested and working well.

@scottleibrand scottleibrand merged commit 188487b into openaps:dev Feb 14, 2020
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.

3 participants