hishel 0.0.26__tar.gz → 0.0.27__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.
Files changed (29) hide show
  1. {hishel-0.0.26 → hishel-0.0.27}/CHANGELOG.md +4 -0
  2. {hishel-0.0.26 → hishel-0.0.27}/PKG-INFO +5 -1
  3. {hishel-0.0.26 → hishel-0.0.27}/hishel/__init__.py +1 -1
  4. {hishel-0.0.26 → hishel-0.0.27}/hishel/_async/_storages.py +3 -1
  5. {hishel-0.0.26 → hishel-0.0.27}/hishel/_sync/_storages.py +3 -1
  6. {hishel-0.0.26 → hishel-0.0.27}/.gitignore +0 -0
  7. {hishel-0.0.26 → hishel-0.0.27}/LICENSE +0 -0
  8. {hishel-0.0.26 → hishel-0.0.27}/README.md +0 -0
  9. {hishel-0.0.26 → hishel-0.0.27}/hishel/_async/__init__.py +0 -0
  10. {hishel-0.0.26 → hishel-0.0.27}/hishel/_async/_client.py +0 -0
  11. {hishel-0.0.26 → hishel-0.0.27}/hishel/_async/_mock.py +0 -0
  12. {hishel-0.0.26 → hishel-0.0.27}/hishel/_async/_pool.py +0 -0
  13. {hishel-0.0.26 → hishel-0.0.27}/hishel/_async/_transports.py +0 -0
  14. {hishel-0.0.26 → hishel-0.0.27}/hishel/_controller.py +0 -0
  15. {hishel-0.0.26 → hishel-0.0.27}/hishel/_exceptions.py +0 -0
  16. {hishel-0.0.26 → hishel-0.0.27}/hishel/_files.py +0 -0
  17. {hishel-0.0.26 → hishel-0.0.27}/hishel/_headers.py +0 -0
  18. {hishel-0.0.26 → hishel-0.0.27}/hishel/_lfu_cache.py +0 -0
  19. {hishel-0.0.26 → hishel-0.0.27}/hishel/_s3.py +0 -0
  20. {hishel-0.0.26 → hishel-0.0.27}/hishel/_serializers.py +0 -0
  21. {hishel-0.0.26 → hishel-0.0.27}/hishel/_sync/__init__.py +0 -0
  22. {hishel-0.0.26 → hishel-0.0.27}/hishel/_sync/_client.py +0 -0
  23. {hishel-0.0.26 → hishel-0.0.27}/hishel/_sync/_mock.py +0 -0
  24. {hishel-0.0.26 → hishel-0.0.27}/hishel/_sync/_pool.py +0 -0
  25. {hishel-0.0.26 → hishel-0.0.27}/hishel/_sync/_transports.py +0 -0
  26. {hishel-0.0.26 → hishel-0.0.27}/hishel/_synchronization.py +0 -0
  27. {hishel-0.0.26 → hishel-0.0.27}/hishel/_utils.py +0 -0
  28. {hishel-0.0.26 → hishel-0.0.27}/hishel/py.typed +0 -0
  29. {hishel-0.0.26 → hishel-0.0.27}/pyproject.toml +0 -0
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.27 (31th May, 2024)
4
+
5
+ - Fix `RedisStorage` when using without ttl. (#231)
6
+
3
7
  ## 0.0.26 (12th April, 2024)
4
8
 
5
9
  - Expose `AsyncBaseStorage` and `BaseStorage`. (#220)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: hishel
3
- Version: 0.0.26
3
+ Version: 0.0.27
4
4
  Summary: Persistent cache implementation for httpx and httpcore
5
5
  Project-URL: Homepage, https://hishel.com
6
6
  Project-URL: Source, https://github.com/karpetrosyan/hishel
@@ -175,6 +175,10 @@ Help us grow and continue developing good software for you ❤️
175
175
 
176
176
  # Changelog
177
177
 
178
+ ## 0.0.27 (31th May, 2024)
179
+
180
+ - Fix `RedisStorage` when using without ttl. (#231)
181
+
178
182
  ## 0.0.26 (12th April, 2024)
179
183
 
180
184
  - Expose `AsyncBaseStorage` and `BaseStorage`. (#220)
@@ -14,4 +14,4 @@ def install_cache() -> None: # pragma: no cover
14
14
  httpx.Client = CacheClient # type: ignore
15
15
 
16
16
 
17
- __version__ = "0.0.26"
17
+ __version__ = "0.0.27"
@@ -424,7 +424,9 @@ class AsyncRedisStorage(AsyncBaseStorage):
424
424
 
425
425
  ttl_in_milliseconds = await self._client.pttl(key)
426
426
 
427
- if ttl_in_milliseconds == -2: # pragma: no cover
427
+ # -2: if the key does not exist in Redis
428
+ # -1: if the key exists in Redis but has no expiration
429
+ if ttl_in_milliseconds == -2 or ttl_in_milliseconds == -1: # pragma: no cover
428
430
  await self.store(key, response, request, metadata)
429
431
  else:
430
432
  await self._client.set(
@@ -424,7 +424,9 @@ class RedisStorage(BaseStorage):
424
424
 
425
425
  ttl_in_milliseconds = self._client.pttl(key)
426
426
 
427
- if ttl_in_milliseconds == -2: # pragma: no cover
427
+ # -2: if the key does not exist in Redis
428
+ # -1: if the key exists in Redis but has no expiration
429
+ if ttl_in_milliseconds == -2 or ttl_in_milliseconds == -1: # pragma: no cover
428
430
  self.store(key, response, request, metadata)
429
431
  else:
430
432
  self._client.set(
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes