redis-allocator 0.5.0__tar.gz → 0.5.1__tar.gz
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-0.5.0/redis_allocator.egg-info → redis_allocator-0.5.1}/PKG-INFO +1 -1
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/pyproject.toml +1 -1
- redis_allocator-0.5.1/redis_allocator/_version.py +1 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator/allocator.py +13 -5
- {redis_allocator-0.5.0 → redis_allocator-0.5.1/redis_allocator.egg-info}/PKG-INFO +1 -1
- redis_allocator-0.5.0/redis_allocator/_version.py +0 -1
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/LICENSE +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/README.md +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator/__init__.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator/lock.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator/task_queue.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator.egg-info/SOURCES.txt +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator.egg-info/dependency_links.txt +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator.egg-info/requires.txt +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator.egg-info/top_level.txt +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/setup.cfg +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/setup.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/tests/__init__.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/tests/conftest.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/tests/test_allocator.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/tests/test_lock.py +0 -0
- {redis_allocator-0.5.0 → redis_allocator-0.5.1}/tests/test_task_queue.py +0 -0
@@ -0,0 +1 @@
|
|
1
|
+
__version__ = '0.5.1'
|
@@ -411,6 +411,7 @@ class DefaultRedisAllocatorPolicy(RedisAllocatorPolicy[U]):
|
|
411
411
|
atexit.register(lambda: self.finalize(self._allocator()))
|
412
412
|
|
413
413
|
def refresh_pool_all(self, allocator: 'RedisAllocator[U]'):
|
414
|
+
allocator.clear()
|
414
415
|
for _ in range(self.updater.params):
|
415
416
|
self.refresh_pool(allocator)
|
416
417
|
|
@@ -833,6 +834,18 @@ class RedisAllocator(RedisLockPool, Generic[U]):
|
|
833
834
|
end
|
834
835
|
'''
|
835
836
|
|
837
|
+
@cached_property
|
838
|
+
def _clear_script(self):
|
839
|
+
return self.redis.register_script(f'''
|
840
|
+
{self._lua_required_string}
|
841
|
+
redis.call("DEL", poolItemsKey)
|
842
|
+
redis.call("SET", headKey, "")
|
843
|
+
redis.call("SET", tailKey, "")
|
844
|
+
''')
|
845
|
+
|
846
|
+
def clear(self):
|
847
|
+
self._clear_script()
|
848
|
+
|
836
849
|
@cached_property
|
837
850
|
def _extend_script(self):
|
838
851
|
"""Cached Lua script to add or update keys in the pool.
|
@@ -975,11 +988,6 @@ class RedisAllocator(RedisLockPool, Generic[U]):
|
|
975
988
|
"""
|
976
989
|
return f'{self.prefix}|{self.suffix}-cache'
|
977
990
|
|
978
|
-
def clear(self):
|
979
|
-
"""Clear all resources from the allocation pool and cache."""
|
980
|
-
super().clear()
|
981
|
-
self.redis.delete(self._cache_str)
|
982
|
-
|
983
991
|
def _soft_bind_name(self, name: str) -> str:
|
984
992
|
"""Get the Redis key for a soft binding.
|
985
993
|
|
@@ -1 +0,0 @@
|
|
1
|
-
__version__ = '0.5.0'
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{redis_allocator-0.5.0 → redis_allocator-0.5.1}/redis_allocator.egg-info/dependency_links.txt
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|