Skip to content

Commit

Permalink
Update docs referebcesto docs.zyte.com.
Browse files Browse the repository at this point in the history
  • Loading branch information
wRAR committed Oct 16, 2024
1 parent 4132ced commit b95d703
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 16 deletions.
2 changes: 1 addition & 1 deletion CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ Changes
------------------

* Improved how the :ref:`default retry policy <default-retry-policy>` handles
:ref:`temporary download errors <zyte-api-temporary-download-errors>`.
:ref:`temporary download errors <zapi-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.
Expand Down
14 changes: 7 additions & 7 deletions docs/use/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -134,40 +134,40 @@ 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 <zyte-api-rate-limit>` and :ref:`unsuccessful
<zyte-api-unsuccessful-responses>` responses, as well as network errors.
retries for :ref:`rate-limiting <zapi-rate-limit>` and :ref:`unsuccessful
<zapi-unsuccessful-responses>` responses, as well as network errors.

.. _retry-policy:
.. _default-retry-policy:

The default retry policy, :data:`~zyte_api.zyte_api_retrying`, does the
following:

- Retries :ref:`rate-limiting responses <zyte-api-rate-limit>` forever.
- Retries :ref:`rate-limiting responses <zapi-rate-limit>` forever.

- Retries :ref:`temporary download errors
<zyte-api-temporary-download-errors>` up to 3 times.
<zapi-temporary-download-errors>` up to 3 times.

- Retries network errors until they have happened for 15 minutes straight.

All retries are done with an exponential backoff algorithm.

.. _aggressive-retry-policy:

If some :ref:`unsuccessful responses <zyte-api-unsuccessful-responses>` exceed
If some :ref:`unsuccessful responses <zapi-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 <zyte-api-permanent-download-errors>` also count towards this retry
errors <zapi-permanent-download-errors>` also count towards this retry
limit.

- Retries permanent download errors up to 3 times.
Expand Down
10 changes: 5 additions & 5 deletions docs/use/cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ The input file can be either of the following:
:http:`request:browserHtml` set to ``True``.

- A `JSON Lines <https://jsonlines.org/>`_ file with a object of :ref:`Zyte
API request parameters <zyte-api-reference>` per line. For example:
API request parameters <zapi-reference>` per line. For example:

.. code-block:: json
Expand Down Expand Up @@ -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
<zyte-api-rate-limit>` and :ref:`unsuccessful
<zyte-api-unsuccessful-responses>` responses, as well as network errors,
<zapi-rate-limit>` and :ref:`unsuccessful
<zapi-unsuccessful-responses>` responses, as well as network errors,
following the :ref:`default retry policy <default-retry-policy>`.

Use ``--dont-retry-errors`` to disable the retrying of error responses, and
retrying only :ref:`rate-limiting responses <zyte-api-rate-limit>`:
retrying only :ref:`rate-limiting responses <zapi-rate-limit>`:

.. code-block:: shell
Expand Down
4 changes: 2 additions & 2 deletions zyte_api/_errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@

class RequestError(ClientResponseError):
"""Exception raised upon receiving a :ref:`rate-limiting
<zyte-api-rate-limit>` or :ref:`unsuccessful
<zyte-api-unsuccessful-responses>` response from Zyte API."""
<zapi-rate-limit>` or :ref:`unsuccessful
<zapi-unsuccessful-responses>` response from Zyte API."""

def __init__(self, *args, **kwargs):
#: Query sent to Zyte API.
Expand Down
2 changes: 1 addition & 1 deletion zyte_api/_retry.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <zyte-api-temporary-download-errors>` and the time network
download errors <zapi-temporary-download-errors>` and the time network
errors are retried:
.. code-block:: python
Expand Down

0 comments on commit b95d703

Please sign in to comment.