octopus-agile-pi-prices icon indicating copy to clipboard operation
octopus-agile-pi-prices copied to clipboard

Retry if no prices available when checked

Open pufferfish-tech opened this issue 5 years ago • 5 comments

@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

pufferfish-tech avatar May 14 '20 19:05 pufferfish-tech

My fix for this issue was to just a run the update script every hour from 4pm to 10pm! It works a treat!

sidewinder42 avatar May 23 '20 17:05 sidewinder42

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.

Chiny91 avatar May 23 '20 18:05 Chiny91

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

beararmy avatar May 23 '20 19:05 beararmy

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 ;)

pufferfish-tech avatar May 23 '20 23:05 pufferfish-tech

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.

pufferfish-tech avatar May 23 '20 23:05 pufferfish-tech