octopus-agile-pi-prices
octopus-agile-pi-prices copied to clipboard
Retry if no prices available when checked
@Chiny91 - I've hacked the script to incorporate a simple retry method as I found the update was failing regularly.
I'm sure this could be made a lot better, but I'm a relative github/python noob so just learning as I go!
@pufferfish-tech - many thanks for sharing this great project!
Originally posted by @plasma-tech in https://github.com/pufferfish-tech/octopus-agile-pi-prices/issues/4#issuecomment-628829824
My fix for this issue was to just a run the update script every hour from 4pm to 10pm! It works a treat!
The problem, probably not a big problem, is that that multiple updating of the price database, makes the database multiple times bigger, and currently it is never pruned.
Having said that, I get the database at 5:nn pm and 7.nn pm, which doubles the size of the database but also works.
If you're getting duplicates can you not do something like I've done Here to check for pre-existance as part of the INSERT
Admittedly that's mariadb, but I think it's fairly generic SQL
Yeah it's what I intend to do, I'm just totally unfamiliar with sqlite (I'm also a mysql/mariadb person). If anyone knows the syntax for SQLite I'll be very appreciative ;)
Also you can delete the SQLite db at any time btw, just rerunning create_price_db to initialise it as per the readme. So, it growing too big isn't a massive deal - for now.