[GNC-dev] Robust error handling and respecting the Apha Vantage API limits in gnc-fq-helper.

Mike Alexander mike at msalexander.com
Thu Feb 6 23:49:39 EST 2020

On 4 Feb 2020, at 6:21, Edward d'Auvergne wrote:

> That's a good point.  In the future, F::Q might also be able to
> respect the API fetching limits across multiple calls, and then this
> would add an additional delay.  That could be fixed by properly timing
> this while loop.  As for sleeping for different times in the loop for
> those with an AlphaVantage subscription, how could that be done?  Do
> you know how F::Q knows about this?  I can see that you can currently
> buy 30, 120, 300, 600, or 1200 API requests per minute.  Should there
> be a GnuCash user setting for this, that is then used by the while
> loop in this perl script?

I don't think this should be a GNuCash configuration option.  Right now 
AlphaVantage tells the caller if too many requests have been made in too 
short a time, but it doesn't return information about how many are too 
many.  F::Q recognizes this error return and delays the next call.  It 
is pretty stupid about how long to delay.  If AlphaVantage returned more 
information about how fast is too fast it could be smarter about it.  
Unless this is changed in AlphaVantage I don't think thee is much that 
could usefully be done about this.


More information about the gnucash-devel mailing list