duneanalytics / dune-client

A framework for interacting with Dune Analytics' officially supported API service
Apache License 2.0
90 stars 21 forks source link

Adjustable polling frequency as env variable #138

Closed JJJJJJJJJJJJJJJl closed 1 month ago

JJJJJJJJJJJJJJJl commented 1 month ago

Reason: When using the client, longer queries will exit with a 429 due to a high number of failed attempts to get a result. Allowing the user to define the poll frequency is beneficial if he's aware that he's running a heavier query.

Still defaults to 1 as it currently is.

bh2smith commented 1 month ago

This is already possible with functions like run_query by passing in your "ping_frequency"

https://github.com/duneanalytics/dune-client/blob/main/dune_client/api/extensions.py

Not sure if it's a great idea to have library constants dynamically loaded. Would love to hear others thoughts...

Cc @msf

JJJJJJJJJJJJJJJl commented 1 month ago

Oh my bad, you're right. I completely missed this somehow.

Closing it, thanks 👍

JJJJJJJJJJJJJJJl commented 1 month ago

I still think it would be cool to have this polling dynamically adjusted using some estimate mechanism on the query to avoid these 429's, but probably not worth the effort though

bh2smith commented 1 month ago

I think dune was having performance issues last week causing many queries to run a very long time. This seems to be resolved now. So you shouldn't even need to adjust the polling anymore.