redis-allocator 0.4.1__py3-none-any.whl → 0.4.2__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.
- redis_allocator/_version.py +1 -1
- redis_allocator/allocator.py +5 -3
- {redis_allocator-0.4.1.dist-info → redis_allocator-0.4.2.dist-info}/METADATA +1 -1
- {redis_allocator-0.4.1.dist-info → redis_allocator-0.4.2.dist-info}/RECORD +8 -8
- tests/test_allocator.py +2 -7
- {redis_allocator-0.4.1.dist-info → redis_allocator-0.4.2.dist-info}/WHEEL +0 -0
- {redis_allocator-0.4.1.dist-info → redis_allocator-0.4.2.dist-info}/licenses/LICENSE +0 -0
- {redis_allocator-0.4.1.dist-info → redis_allocator-0.4.2.dist-info}/top_level.txt +0 -0
redis_allocator/_version.py
CHANGED
@@ -1 +1 @@
|
|
1
|
-
__version__ = '0.4.
|
1
|
+
__version__ = '0.4.2'
|
redis_allocator/allocator.py
CHANGED
@@ -199,6 +199,8 @@ class RedisAllocatorObject(Generic[U]):
|
|
199
199
|
self.key = new_obj.key
|
200
200
|
self.params = new_obj.params
|
201
201
|
self.open()
|
202
|
+
elif self.obj is not None:
|
203
|
+
logger.error("Failed to refresh the object %s", self.key)
|
202
204
|
|
203
205
|
def refresh_until_healthy(self, timeout: Timeout = 120, max_attempts: int = 10, lock_duration: Timeout = 3600, cache_timeout: Timeout = 3600):
|
204
206
|
"""Refresh the object until it is healthy."""
|
@@ -226,9 +228,9 @@ class RedisAllocatorObject(Generic[U]):
|
|
226
228
|
return None
|
227
229
|
return self.obj.name
|
228
230
|
|
229
|
-
def __del__(self):
|
230
|
-
|
231
|
-
|
231
|
+
# def __del__(self):
|
232
|
+
# """Delete the object."""
|
233
|
+
# self.close()
|
232
234
|
|
233
235
|
|
234
236
|
class RedisAllocatorUpdater:
|
@@ -1,15 +1,15 @@
|
|
1
1
|
redis_allocator/__init__.py,sha256=TVjUm-8YEu_MQD_PkfeIKiVknpCJBrUY9cWN1LlaZcU,1016
|
2
|
-
redis_allocator/_version.py,sha256=
|
3
|
-
redis_allocator/allocator.py,sha256=
|
2
|
+
redis_allocator/_version.py,sha256=zrcTwxP3SA3F1Js78afrfeaZeJr8w2hLtFtEZoUqUmg,22
|
3
|
+
redis_allocator/allocator.py,sha256=RL1opmUfi5OFDmCe43O_aK--st0Wfi55t4rK7YzT2S4,48889
|
4
4
|
redis_allocator/lock.py,sha256=fqf6WUWHKYenEArWopMIF6kWEnDfADC-bZvnQImsQVo,27400
|
5
5
|
redis_allocator/task_queue.py,sha256=8DjNr2uxhzCsHatV_CHOeGh7_K9pqQZFApSbe2blRO0,14989
|
6
|
-
redis_allocator-0.4.
|
6
|
+
redis_allocator-0.4.2.dist-info/licenses/LICENSE,sha256=Wt4X1rHpffQfEiyWcDUx8BMLjXxfPqaiYZ7Lgsj7L4c,1068
|
7
7
|
tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
tests/conftest.py,sha256=Ts82uylQSzP_GcaN0E02o3xcFdjw20cXNzh3RAdYKW4,3967
|
9
|
-
tests/test_allocator.py,sha256=
|
9
|
+
tests/test_allocator.py,sha256=_aoSDkzyjiUyzw6WoO2bMV1Ow9ymLOOMSJrp7TENU70,22139
|
10
10
|
tests/test_lock.py,sha256=MDMRNN46VhWqkHUIhYOMEDgZkFFCW_WjwRLTOjkFF-Q,46952
|
11
11
|
tests/test_task_queue.py,sha256=Fh5naikFajfOvL6GngEy_TPfOYCYZolZfVwtR6T4dTY,31710
|
12
|
-
redis_allocator-0.4.
|
13
|
-
redis_allocator-0.4.
|
14
|
-
redis_allocator-0.4.
|
15
|
-
redis_allocator-0.4.
|
12
|
+
redis_allocator-0.4.2.dist-info/METADATA,sha256=2i_PpL_MD-TCX1yVddl9YObBPtatBrRQQNYImBAeB5M,21727
|
13
|
+
redis_allocator-0.4.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
14
|
+
redis_allocator-0.4.2.dist-info/top_level.txt,sha256=0hXzU7sK5FCeSolTEYxThOt3HOybnwaXv1FLRJvHVgI,22
|
15
|
+
redis_allocator-0.4.2.dist-info/RECORD,,
|
tests/test_allocator.py
CHANGED
@@ -214,13 +214,8 @@ class TestRedisAllocatorObject:
|
|
214
214
|
obj.close()
|
215
215
|
assert test_object.closed
|
216
216
|
obj.close() # Should not raise
|
217
|
-
|
218
|
-
|
219
|
-
"""Test the __del__ method."""
|
220
|
-
obj = RedisAllocatorObject(redis_allocator, "test_key", test_object, {})
|
221
|
-
obj.close = mocker.MagicMock()
|
222
|
-
obj.__del__()
|
223
|
-
obj.close.assert_called_once()
|
217
|
+
obj.refresh()
|
218
|
+
assert not test_object.closed
|
224
219
|
|
225
220
|
|
226
221
|
class TestRedisAllocator:
|
File without changes
|
File without changes
|
File without changes
|