kbgg / qgis-stac-browser

Plugin for QGIS to browse and download assets from STAC APIs
Apache License 2.0
26 stars 9 forks source link

Hang if API endpoint cannot be connected to #17

Closed philvarner closed 5 years ago

philvarner commented 5 years ago

The loading bar window hangs if the server is down. For example, I added to Config.STAC_APIS 'http://localhost:22902/api/v2', and started the plugin, even though I'd neglected to start the server locally.

This is likely a general issue with how the API requests are being done, with no timeouts. Recommendation is to at least add connections and socket timeouts, and possibly add code like [https://pypi.org/project/timeout-decorator/] that will timeout a request even if its not causing the socket timeout, but the data return rate is intolerably slow.