python3-commons 0.20.7__py3-none-any.whl → 0.20.8__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,3 @@
1
- import asyncio
2
1
  import contextlib
3
2
  import logging
4
3
  import time
@@ -159,19 +158,18 @@ class AsyncSessionManager:
159
158
  logger.debug('Acquiring session for %r', name)
160
159
 
161
160
  try:
162
- async with asyncio.timeout(self.pool_acquire_timeout):
163
- async with session_maker() as session:
164
- session_acquired = True
165
- elapsed = time.monotonic() - t0
166
- logger.debug('Session acquired for %r in %.3fs', name, elapsed)
167
-
168
- try:
169
- yield session
170
- except Exception:
171
- logger.exception('Database communication error for %r; rolling back', name)
172
- await session.rollback()
173
-
174
- raise
161
+ async with session_maker() as session:
162
+ session_acquired = True
163
+ elapsed = time.monotonic() - t0
164
+ logger.debug('Session acquired for %r in %.3fs', name, elapsed)
165
+
166
+ try:
167
+ yield session
168
+ except Exception:
169
+ logger.exception('Database communication error for %r; rolling back', name)
170
+ await session.rollback()
171
+
172
+ raise
175
173
  except TimeoutError as e:
176
174
  if session_acquired:
177
175
  raise
@@ -230,10 +228,9 @@ async def is_healthy(
230
228
  t0 = time.monotonic()
231
229
 
232
230
  try:
233
- async with asyncio.timeout(timeout):
234
- async with engine.begin() as conn:
235
- result = await conn.execute(text('SELECT 1'))
236
- healthy = result.scalar() == 1
231
+ async with engine.begin() as conn:
232
+ result = await conn.execute(text('SELECT 1'))
233
+ healthy = result.scalar() == 1
237
234
 
238
235
  elapsed = time.monotonic() - t0
239
236
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python3-commons
3
- Version: 0.20.7
3
+ Version: 0.20.8
4
4
  Summary: Re-usable Python3 code
5
5
  Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
6
6
  License-Expression: GPL-3.0
@@ -12,7 +12,7 @@ python3_commons/helpers.py,sha256=d1xdxiOyskwq_rzSprB7e7Fo8Hp0uDlWSmRWFL4vC6A,49
12
12
  python3_commons/object_storage.py,sha256=2l8v1mDB5WWN6jhxH2t5xmHBXaVPRJl0z44wExmlO80,7175
13
13
  python3_commons/permissions.py,sha256=gaMKSWg0MgPQTdP1voll4ItXcblXku9BlD0Lq3Xv64U,1724
14
14
  python3_commons/soap_client.py,sha256=w2lOyhhtkhwiNnHjvir8DfjGBO51XVg5rlDHyuudU2A,7169
15
- python3_commons/db/__init__.py,sha256=V4f9SnQvTYYM_RRqg2-dz6KL6vOmsIrTjS_XbRq2TZ8,9166
15
+ python3_commons/db/__init__.py,sha256=Ze5OtqF-yyD9dY0GNljMX9uZAE9E0aw0XAniwYUkjSM,8983
16
16
  python3_commons/db/helpers.py,sha256=xRpWs4aVkBge6HCLjb6OLSnWc1nlV6rKGyaVhZ_x12w,2001
17
17
  python3_commons/db/models/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
18
18
  python3_commons/db/models/auth.py,sha256=t6z_0c7l_1eB-CCdnPSV9OzJ_ymgkwD1cLpecNhQgoA,773
@@ -27,9 +27,9 @@ python3_commons/serializers/common.py,sha256=VkA7C6wODvHk0QBXVX_x2JieDstihx3U__U
27
27
  python3_commons/serializers/json.py,sha256=UPkC3ps13x2C_NxwVV-K7Ewp4VjkVHSSUkJVw5k7Wiw,712
28
28
  python3_commons/serializers/msgpack.py,sha256=zESFBX34GsZ8rDu6Zk5V6CLT6P0mPilU0r04Ka6TblI,1474
29
29
  python3_commons/serializers/msgspec.py,sha256=upy5CBmK66-8hYnK5bAM_sZvZY5CAqZmzCw9GIF346I,2988
30
- python3_commons-0.20.7.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
- python3_commons-0.20.7.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
- python3_commons-0.20.7.dist-info/METADATA,sha256=dNE1cEVe-kzCqwJzrv9PY-Nfm7YfrD3NcijdddSkrtU,2333
33
- python3_commons-0.20.7.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
- python3_commons-0.20.7.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
- python3_commons-0.20.7.dist-info/RECORD,,
30
+ python3_commons-0.20.8.dist-info/licenses/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
31
+ python3_commons-0.20.8.dist-info/licenses/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
32
+ python3_commons-0.20.8.dist-info/METADATA,sha256=JIQ9Wj8LBQMV6QjE7Z3lzyG0JBWHQfrsf_3_AJCtueI,2333
33
+ python3_commons-0.20.8.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
34
+ python3_commons-0.20.8.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
35
+ python3_commons-0.20.8.dist-info/RECORD,,