timwie / aio-overpass

Async client for the Overpass API
https://pypi.org/project/aio-overpass/
MIT License
4 stars 1 forks source link

Add timeout duration for individual tries #3

Closed timwie closed 11 months ago

timwie commented 1 year ago

In this CI job, we have a query with a timeout of 180 seconds that fails its first try after 440 seconds. I would think that it makes sense to limit the duration of a try by default, with some time longer than the [timeout:] setting. Currently you could only do that with run_timeout_secs, but that is intended to be a timeout for all tries of a query; not a single one. With [timeout:180] you probably want a run_timeout_secs that is a multiple of that 180 seconds, but less than that for individual tries.

timwie commented 11 months ago

This is now possible using RequestTimeout. The default is an additional 20 seconds on top of the query [timeout:], so a request with [timeout:180] would timeout after 200 seconds.