[GNC-dev] Alphavantage strategies

Wm wm_o_o_o at yahoo.co.uk
Tue Jan 15 16:31:35 EST 2019


I was unaware [1] until recently that Alphavantage wanted individuals / 
non-subscribers / poor people / whoever doesn't pay / to back off a bit. 
  I don't have a problem with this, it is a good free service and it has 
been obvious they're struggling.

[1] but not surprised to discover

There have been postings in the .user list (one of them being mine) that 
involve editing files in the F:Q install to mitigate this.  Not a good 
idea as the next update overwrites any changes, users shouldn't have to 
get involved, may not be reading the list, sleep(15) is arbitrary, etc.

Let's consider some simple backoff strategies that gnc could implement, 
feel free to add your own.

Wm's suggestion
===============
only collect if the most recent price is more than 1 day (or 12 hours, 
etc) old [2].  this sort of fits in with the existing post collection 
query, i.e. always store the good prices that have been obtained, 
instead ask the user, "do you want to try and fetch the other prices / 
rates again".  this provides a natural pause to Alphavantage as gnc 
won't be hitting it for prices it just got a second time and would only 
be requesting the prices it didn't get last time.

[2] I use this in my own collections (external to gnc) run by cron, some 
more obscure currency pairs are only available a few hours a day, I 
don't even try if the most recent is less than a day old.

-- 
Wm















More information about the gnucash-devel mailing list