TheStalwart / banknote-tabulator

A better way to browse used laptops on veikals.banknote.lv
MIT License
0 stars 1 forks source link

Delete product cache for items not present in index #23

Open TheStalwart opened 4 months ago

TheStalwart commented 4 months ago

In current production database there are caches for 2220 items, but latest index only contains 1621 items.

I would prefer to keep caches for a month or so after they've been removed from index, but i assume items missing from index for a month are either sold or scrapped

TheStalwart commented 4 months ago

The next step would be to implement some kind of "last seen on %date%" property storage for every item and gather data for a month.

Then, have a function to delete caches for items not seen for a month

TheStalwart commented 3 months ago
stalwart@hindenburg:/var/www/sites/banknote-tabulator/inventory/products $ ls */last_seen | wc -l
1720
stalwart@hindenburg:/var/www/sites/banknote-tabulator/inventory/products $ ls | wc -l
2771

since initial scrape of banknote, >1000 laptops had been either sold or scrapped that's 250 laptops per month

TheStalwart commented 3 months ago

Next step: delete all products with missing last_seen file because that data is useless for #24