brown-SSW / brown-solar-charger

This program monitors a solar power system and runs a physical and online dashboard.
https://brown-ssw.github.io/brown-solar-charger/
4 stars 1 forks source link

delete old firebase data #26

Closed joshua-8 closed 3 years ago

joshua-8 commented 3 years ago

"daily" data should be removed after 24 hours, "month data" should be removed after 30 days

this will keep the database from growing too large

Could be done by firebase functions (requires blaze plan), by esp32 on station possibly, maybe by script running from spreadsheet, google cloud platform may give a free low power virtual machine? Another way to have the esp32 do this is have it store the data locally and overwrite each array completely each update (bonus, could write data as proper json array) Experiments are needed

joshua-8 commented 3 years ago

use query and filter to try to get the oldest node, check timestamp and delete it by name if necessary