Skip to content

Commit c64fb10

Browse files
committed
Fix async transactions code example in docs
1 parent 0afab5b commit c64fb10

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

docs/async_examples.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -90,35 +90,35 @@ Let's create transactional cache:
9090
.. literalinclude:: ../examples/transactions.py
9191
:language: python
9292
:dedent: 8
93-
:lines: 29-32
93+
:lines: 30-33
9494

9595
Let's start a transaction and commit it:
9696

9797
.. literalinclude:: ../examples/transactions.py
9898
:language: python
9999
:dedent: 8
100-
:lines: 35-40
100+
:lines: 36-41
101101

102102
Let's check that the transaction was committed successfully:
103103

104104
.. literalinclude:: ../examples/transactions.py
105105
:language: python
106106
:dedent: 8
107-
:lines: 42-44
107+
:lines: 44-45
108108

109109
Let's check that raising exception inside `async with` block leads to transaction's rollback
110110

111111
.. literalinclude:: ../examples/transactions.py
112112
:language: python
113113
:dedent: 8
114-
:lines: 47-58
114+
:lines: 48-59
115115

116116
Let's check that timed out transaction is successfully rolled back
117117

118118
.. literalinclude:: ../examples/transactions.py
119119
:language: python
120120
:dedent: 8
121-
:lines: 61-72
121+
:lines: 62-73
122122

123123
See more info about transaction's parameters in a documentation of :py:meth:`~pyignite.aio_client.AioClient.tx_start`
124124

examples/transactions.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ async def async_example():
6969
print(e)
7070

7171
# key=1 value=success
72-
val = await cache.get(1)
72+
val = await cache.get(key)
7373
print(f"key=1 value={val}")
7474

7575
# destroy cache

0 commit comments

Comments
 (0)