pybiolib 1.2.216__py3-none-any.whl → 1.2.221__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.
@@ -78,6 +78,7 @@ class HttpClient:
78
78
  retries: int = 5,
79
79
  timeout_in_seconds: Optional[int] = None,
80
80
  response_path: Optional[str] = None,
81
+ retry_on_http_500: Optional[bool] = False,
81
82
  ) -> HttpResponse:
82
83
  if not HttpClient.ssl_context:
83
84
  HttpClient.ssl_context = _create_ssl_context()
@@ -112,6 +113,9 @@ class HttpClient:
112
113
  if error.code == 429:
113
114
  logger_no_user_data.warning(f'HTTP {method} request failed with status 429 for "{url}"')
114
115
  last_error = error
116
+ elif error.code == 500 and retry_on_http_500:
117
+ logger_no_user_data.warning(f'HTTP {method} request failed with status 500 for "{url}"')
118
+ last_error = error
115
119
  elif error.code == 502:
116
120
  logger_no_user_data.warning(f'HTTP {method} request failed with status 502 for "{url}"')
117
121
  last_error = error
biolib/utils/__init__.py CHANGED
@@ -87,12 +87,18 @@ def _download_chunk(input_tuple: DownloadChunkInputTuple) -> bytes:
87
87
  byte_range, presigned_url = input_tuple
88
88
  start, end = byte_range
89
89
 
90
- response = HttpClient.request(
91
- url=presigned_url,
92
- headers={'range': f'bytes={start}-{end}'},
93
- timeout_in_seconds=300, # timeout after 5 min
94
- retries=10,
95
- )
90
+ try:
91
+ response = HttpClient.request(
92
+ url=presigned_url,
93
+ headers={'range': f'bytes={start}-{end}'},
94
+ timeout_in_seconds=300, # timeout after 5 min
95
+ retries=20,
96
+ retry_on_http_500=True,
97
+ )
98
+ except Exception as exception:
99
+ logger_no_user_data.exception("Hit error downloading chunk")
100
+ logger_no_user_data.error(exception)
101
+ raise exception
96
102
  logger_no_user_data.debug(f'Returning raw data for part {start}')
97
103
  return response.content
98
104
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.2.216
3
+ Version: 1.2.221
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -10,7 +10,7 @@ biolib/_internal/data_record/remote_storage_endpoint.py,sha256=eCptuZ4DMAPnaNCVD
10
10
  biolib/_internal/file_utils.py,sha256=4jT6j7bB21c0JNn5BfnyWQib_zt0CVtJ_TiOFOStRcE,2604
11
11
  biolib/_internal/fuse_mount/__init__.py,sha256=B_tM6RM2dBw-vbpoHJC4X3tOAaN1H2RDvqYJOw3xFwg,55
12
12
  biolib/_internal/fuse_mount/experiment_fuse_mount.py,sha256=08aUdEq_bvqLBft_gSLjOClKDy5sBnMts1RfJf7AP_U,7012
13
- biolib/_internal/http_client.py,sha256=Q8tUvXL9rxTrPgNxoI8VGTGI8-AgF2ZF0___s8kCGkY,5440
13
+ biolib/_internal/http_client.py,sha256=C0bHqVrenT3ifZ3k0FdzBZR7ZxDXKBUG148KRxheAyk,5701
14
14
  biolib/_internal/lfs/__init__.py,sha256=gSWo_xg61UniYgD7yNYxeT4I9uaXBCBSi3_nmZjnPpE,35
15
15
  biolib/_internal/lfs/cache.py,sha256=pQS2np21rdJ6I3DpoOutnzPHpLOZgUIS8TMltUJk_k4,2226
16
16
  biolib/_internal/libs/__init__.py,sha256=Jdf4tNPqe_oIIf6zYml6TiqhL_02Vyqwge6IELrAFhw,98
@@ -114,14 +114,14 @@ biolib/templates/example_app.py,sha256=EB3E3RT4SeO_ii5nVQqJpi5KDGNE_huF1ub-e5ZFv
114
114
  biolib/typing_utils.py,sha256=ntzrlyTkUaO2OtccLYzCAGztGdca0WT5fikJUmSkT-Y,148
115
115
  biolib/user/__init__.py,sha256=Db5wtxLfFz3ID9TULSSTo77csw9tO6RtxMRvV5cqKEE,39
116
116
  biolib/user/sign_in.py,sha256=XTAmRPKfmg7VAaB8cT5wcmfxoPXeHqY8LmDiADF7zbw,2064
117
- biolib/utils/__init__.py,sha256=fwjciJyJicvYyZcVTzfDBgD0SKY13DeXqvTeG4qZIy8,5548
117
+ biolib/utils/__init__.py,sha256=VtuTFu8zWZwJzfYhVEpPdlhvTA2JkHCboqqQA-VNkpA,5790
118
118
  biolib/utils/app_uri.py,sha256=Yq_-_VGugQhMMo6mM5f0G9yNlLkr0WK4j0Nrf3FE4xQ,2171
119
119
  biolib/utils/cache_state.py,sha256=u256F37QSRIVwqKlbnCyzAX4EMI-kl6Dwu6qwj-Qmag,3100
120
120
  biolib/utils/multipart_uploader.py,sha256=XvGP1I8tQuKhAH-QugPRoEsCi9qvbRk-DVBs5PNwwJo,8452
121
121
  biolib/utils/seq_util.py,sha256=Ozk0blGtPur_D9MwShD02r_mphyQmgZkx-lOHOwnlIM,6730
122
122
  biolib/utils/zip/remote_zip.py,sha256=0wErYlxir5921agfFeV1xVjf29l9VNgGQvNlWOlj2Yc,23232
123
- pybiolib-1.2.216.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
124
- pybiolib-1.2.216.dist-info/METADATA,sha256=c2wscSs5tFgJ-a2WLknbRy70BlrljRDnB032X4fl5fo,1558
125
- pybiolib-1.2.216.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
126
- pybiolib-1.2.216.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
127
- pybiolib-1.2.216.dist-info/RECORD,,
123
+ pybiolib-1.2.221.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
124
+ pybiolib-1.2.221.dist-info/METADATA,sha256=8NVC3cqB7FxyvdBVvQdS0uwnAYGGFfMIzyTssOX9CHk,1558
125
+ pybiolib-1.2.221.dist-info/WHEEL,sha256=Nq82e9rUAnEjt98J6MlVmMCZb-t9cYE2Ir1kpBmnWfs,88
126
+ pybiolib-1.2.221.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
127
+ pybiolib-1.2.221.dist-info/RECORD,,