Hi,

We have a plugin that runs a background task to download some data from an
external WFS service via QgsVectorLayer. The API is limited to 100 features
per call, requiring us to page our requests, and to 600 calls a minute.

If we make too many calls per minute then we get HTTP 429 warnings in the
OGR log and the download task terminates with incomplete data. The
QgsVectorLayer and QgsVectorDataProvider return isValid() as False and
featureCount() as -2, but hasErrors() is False and errors() is empty. This
is no different than the call failing due to there being no data, so is no
real use.

What I want is to be able to detect the 429 errors and implement a retry
strategy, but there seems no way to access this info? Am I missing the
obvious here? Or am I doomed to using urllib to make the calls manually?

Cheers!

John.
_______________________________________________
Qgis-user mailing list
Qgis-user@lists.osgeo.org
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to