Skip to content

Commit

Permalink
Doc Fix confusion about TransportQueryError execute retries (#473)
Browse files Browse the repository at this point in the history
  • Loading branch information
leszekhanusz committed Mar 6, 2024
1 parent 48bb94c commit 40f07cf
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/advanced/async_permanent_session.rst
Expand Up @@ -75,7 +75,6 @@ backoff decorator to the :code:`retry_execute` argument.
backoff.expo,
Exception,
max_tries=3,
giveup=lambda e: isinstance(e, TransportQueryError),
)
session = await client.connect_async(
reconnecting=True,
Expand All @@ -84,6 +83,18 @@ backoff decorator to the :code:`retry_execute` argument.
If you don't want any retry on the execute calls, you can disable the retries with :code:`retry_execute=False`

.. note::
If you want to retry even with :code:`TransportQueryError` exceptions,
then you need to make your own backoff decorator on your own method:

.. code-block:: python
@backoff.on_exception(backoff.expo,
Exception,
max_tries=3)
async def execute_with_retry(session, query):
return await session.execute(query)
Subscription retries
^^^^^^^^^^^^^^^^^^^^

Expand Down

0 comments on commit 40f07cf

Please sign in to comment.