pybiolib 1.1.1007__py3-none-any.whl → 1.1.1011__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.
@@ -68,17 +68,17 @@ class CacheState(abc.ABC, Generic[StateType]):
68
68
  logger_no_user_data.debug(f'CacheState: Exited state path: {self._state_path}')
69
69
 
70
70
  def _acquire_state_lock(self) -> None:
71
- timeout_seconds = 5.0
72
- seconds_to_sleep = 0.5
71
+ for _ in range(10):
72
+ try:
73
+ lock_file = open(self._state_lock_path, mode='x')
74
+ lock_file.close()
75
+ return
76
+ except BaseException as error: # pylint: disable=broad-except
77
+ logger_no_user_data.debug(f'Failed to acquire lock file "{self._state_lock_path}". Got error: {error}')
73
78
 
74
- while os.path.exists(self._state_lock_path):
75
- time.sleep(seconds_to_sleep)
76
- timeout_seconds -= seconds_to_sleep
77
- if timeout_seconds < 0:
78
- raise CacheStateError('Cache state timed out waiting for lock file')
79
+ time.sleep(0.5)
79
80
 
80
- lock_file = open(self._state_lock_path, mode='x')
81
- lock_file.close()
81
+ raise CacheStateError(f'Cache state timed out waiting to acquire lock file "{self._state_lock_path}"')
82
82
 
83
83
  def _release_state_lock(self) -> None:
84
84
  if os.path.exists(self._state_lock_path):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: pybiolib
3
- Version: 1.1.1007
3
+ Version: 1.1.1011
4
4
  Summary: BioLib Python Client
5
5
  Home-page: https://github.com/biolib
6
6
  License: MIT
@@ -98,7 +98,7 @@ biolib/typing_utils.py,sha256=krMhxB3SedVQA3HXIrC7DBXWpHKWN5JNmXGcSrrysOc,263
98
98
  biolib/user/__init__.py,sha256=Db5wtxLfFz3ID9TULSSTo77csw9tO6RtxMRvV5cqKEE,39
99
99
  biolib/user/sign_in.py,sha256=CvHBgoYjg5d5CL9etVopns_g1pImgW8mQH3zAjpe1Ik,2061
100
100
  biolib/utils/__init__.py,sha256=a_7oy3XCxrVDdsCynxjw27tOgOongkOh0bw8cp6TXWo,8219
101
- biolib/utils/cache_state.py,sha256=9krGTBGbklI3pLojRag7gWPR8MpduodGcTabEr7LY6I,2966
101
+ biolib/utils/cache_state.py,sha256=BFrZlV4XZIueIFzAFiPidX4hmwADKY5Y5ZuqlerF5l0,3060
102
102
  biolib/utils/multipart_uploader.py,sha256=XFEz-4LRNVFNR6D_FKCecjxosY0bgaR5DGigKAyY5iI,9717
103
103
  biolib/utils/seq_util.py,sha256=CEFtNVBcnmVq_801T_jT4g1O30_iI4P-sRZ2GCU9EqU,1757
104
104
  biolib/utils/zip/remote_zip.py,sha256=NCdUnVbGCv7SfXCI-yVU-is_OnyWmLAnVpIdSvo-W4k,23500
@@ -107,8 +107,8 @@ biolib/validators/validate_argument.py,sha256=B-tqgMgXuTvJLhaMWcBTUKw18L5brJtIdf
107
107
  biolib/validators/validate_module.py,sha256=aHe0YAWFSrMbZNw-h64oweqruDS-k7KOUzK1ECpG8Wg,13298
108
108
  biolib/validators/validate_zip_file.py,sha256=2j8kJ1WF2u5OyMkfEDCoU_BvOtr8gLPWTtsmUG0zQ5g,1655
109
109
  biolib/validators/validator_utils.py,sha256=2QCJWdKiLTUHsvjDidrXKBjH95kKsEmFwd17muTGL0M,2135
110
- pybiolib-1.1.1007.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
111
- pybiolib-1.1.1007.dist-info/METADATA,sha256=wwR8bvT8SaHpkazaN1YKMnjVEE5I-9IYV0AZqppwj8I,1612
112
- pybiolib-1.1.1007.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
113
- pybiolib-1.1.1007.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
114
- pybiolib-1.1.1007.dist-info/RECORD,,
110
+ pybiolib-1.1.1011.dist-info/LICENSE,sha256=F2h7gf8i0agDIeWoBPXDMYScvQOz02pAWkKhTGOHaaw,1067
111
+ pybiolib-1.1.1011.dist-info/METADATA,sha256=oJS8zh0ywTWDD79FbnPQjbYPy_GXh2XcqWnyUUhEVtY,1612
112
+ pybiolib-1.1.1011.dist-info/WHEEL,sha256=Zb28QaM1gQi8f4VCBhsUklF61CTlNYfs9YAZn-TOGFk,88
113
+ pybiolib-1.1.1011.dist-info/entry_points.txt,sha256=p6DyaP_2kctxegTX23WBznnrDi4mz6gx04O5uKtRDXg,42
114
+ pybiolib-1.1.1011.dist-info/RECORD,,