From b95d703fd9c4f607d7a424797fc17b056ef22945 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Wed, 16 Oct 2024 14:13:18 +0500 Subject: [PATCH] Update docs referebcesto docs.zyte.com. --- CHANGES.rst | 2 +- docs/use/api.rst | 14 +++++++------- docs/use/cli.rst | 10 +++++----- zyte_api/_errors.py | 4 ++-- zyte_api/_retry.py | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 55e4c49..fb5fff1 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ Changes ------------------ * Improved how the :ref:`default retry policy ` handles - :ref:`temporary download errors `. + :ref:`temporary download errors `. Before, 3 HTTP 429 responses followed by a single HTTP 520 response would have prevented a retry. Now, unrelated responses and errors do not count towards the HTTP 520 retry limit. diff --git a/docs/use/api.rst b/docs/use/api.rst index 7d05a47..8e3d34e 100644 --- a/docs/use/api.rst +++ b/docs/use/api.rst @@ -134,15 +134,15 @@ The number of concurrent connections if enforced across all method calls, including different sessions of the same client. For guidelines on how to choose the optimal value for you, and other -optimization tips, see :ref:`zyte-api-optimize`. +optimization tips, see :ref:`zapi-optimize`. Errors and retries ================== Methods of :class:`ZyteAPI` and :class:`AsyncZyteAPI` automatically handle -retries for :ref:`rate-limiting ` and :ref:`unsuccessful -` responses, as well as network errors. +retries for :ref:`rate-limiting ` and :ref:`unsuccessful +` responses, as well as network errors. .. _retry-policy: .. _default-retry-policy: @@ -150,10 +150,10 @@ retries for :ref:`rate-limiting ` and :ref:`unsuccessful The default retry policy, :data:`~zyte_api.zyte_api_retrying`, does the following: -- Retries :ref:`rate-limiting responses ` forever. +- Retries :ref:`rate-limiting responses ` forever. - Retries :ref:`temporary download errors - ` up to 3 times. + ` up to 3 times. - Retries network errors until they have happened for 15 minutes straight. @@ -161,13 +161,13 @@ All retries are done with an exponential backoff algorithm. .. _aggressive-retry-policy: -If some :ref:`unsuccessful responses ` exceed +If some :ref:`unsuccessful responses ` exceed maximum retries with the default retry policy, try using :data:`~zyte_api.aggressive_retrying` instead, which modifies the default retry policy as follows: - Temporary download error are retried 7 times. :ref:`Permanent download - errors ` also count towards this retry + errors ` also count towards this retry limit. - Retries permanent download errors up to 3 times. diff --git a/docs/use/cli.rst b/docs/use/cli.rst index 49f4a9a..abf2479 100644 --- a/docs/use/cli.rst +++ b/docs/use/cli.rst @@ -33,7 +33,7 @@ The input file can be either of the following: :http:`request:browserHtml` set to ``True``. - A `JSON Lines `_ file with a object of :ref:`Zyte - API request parameters ` per line. For example: + API request parameters ` per line. For example: .. code-block:: json @@ -84,19 +84,19 @@ order and hence distribute the load somewhat evenly: zyte-api urls.txt --shuffle … For guidelines on how to choose the optimal ``--n-conn`` value for you, and -other optimization tips, see :ref:`zyte-api-optimize`. +other optimization tips, see :ref:`zapi-optimize`. Errors and retries ================== ``zyte-api`` automatically handles retries for :ref:`rate-limiting -` and :ref:`unsuccessful -` responses, as well as network errors, +` and :ref:`unsuccessful +` responses, as well as network errors, following the :ref:`default retry policy `. Use ``--dont-retry-errors`` to disable the retrying of error responses, and -retrying only :ref:`rate-limiting responses `: +retrying only :ref:`rate-limiting responses `: .. code-block:: shell diff --git a/zyte_api/_errors.py b/zyte_api/_errors.py index ea589ae..6476c39 100644 --- a/zyte_api/_errors.py +++ b/zyte_api/_errors.py @@ -10,8 +10,8 @@ class RequestError(ClientResponseError): """Exception raised upon receiving a :ref:`rate-limiting - ` or :ref:`unsuccessful - ` response from Zyte API.""" + ` or :ref:`unsuccessful + ` response from Zyte API.""" def __init__(self, *args, **kwargs): #: Query sent to Zyte API. diff --git a/zyte_api/_retry.py b/zyte_api/_retry.py index 04b16b1..3b01c0e 100644 --- a/zyte_api/_retry.py +++ b/zyte_api/_retry.py @@ -137,7 +137,7 @@ class RetryFactory: the corresponding :class:`tenacity.AsyncRetrying` object. For example, to double the number of attempts for :ref:`temporary - download errors ` and the time network + download errors ` and the time network errors are retried: .. code-block:: python