BlockSci icon indicating copy to clipboard operation
BlockSci copied to clipboard

CurrencyConverter tool failing (502 Server Error)

Open mosessoh opened this issue 7 years ago • 2 comments

image

I'm guessing that it's hitting some limit on the maximum number of entries that can be returned.

Works

  • https://api.coindesk.com/v1/bpi/historical/close.json?index=USD&currency=USD&start=2010-07-21&end=2018-02-20
  • https://api.coindesk.com/v1/bpi/historical/close.json?index=USD&currency=USD&start=2010-07-19&end=2018-02-19

Fails (in screenshot above)

  • https://api.coindesk.com/v1/bpi/historical/close.json?index=USD&currency=USD&start=2010-07-19&end=2018-02-20

mosessoh avatar Feb 20 '18 03:02 mosessoh

I solved this by persisting previous responses in a local DB and only querying for new data. But I'm not sure how the BlockSci team wants to do this for your official distribution.

mosessoh avatar Feb 20 '18 03:02 mosessoh

Currently there's no internal rate limiting in the CurrencyConverter and thus it starts getting blocked if it gets used to frequently. Persisting to a local DB definitely seems like a good approach to handle this. We should definitely add functionality into the library to handle this class of errors nicely rather than just throwing the Gateway error at the user with no context.

hkalodner avatar Mar 09 '18 21:03 hkalodner