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

Implement retention period #2

Open
terual opened this issue Apr 21, 2024 · 2 comments
Open

Implement retention period #2

terual opened this issue Apr 21, 2024 · 2 comments

Comments

@terual
Copy link
Member

terual commented Apr 21, 2024

I think it would be good to delete the raw data after a certain retention period (Home Assistant uses 60 days). If a system does not send an update within 60 days we can conclude the install is not active anymore, so it can be deleted to not skew the totals.

@michaelherger
Copy link
Member

Yep, we should do that. I'll add a line to the update tasks. Should be a simple DELETE request.

@michaelherger
Copy link
Member

DELETE FROM <table> WHERE UNIXEPOCH(DATETIME()) - UNIXEPOCH(lastseen) > 86400*60

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

No branches or pull requests

2 participants