hishel 1.0.0.dev0__py3-none-any.whl → 1.0.0.dev2__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.
- hishel/_async_cache.py +9 -2
- hishel/_core/_async/_storages/_sqlite.py +402 -356
- hishel/_core/_spec.py +120 -67
- hishel/_core/_sync/_storages/_sqlite.py +402 -356
- hishel/_core/models.py +7 -4
- hishel/_sync_cache.py +9 -2
- hishel/_utils.py +1 -377
- hishel/httpx.py +9 -2
- {hishel-1.0.0.dev0.dist-info → hishel-1.0.0.dev2.dist-info}/METADATA +48 -53
- hishel-1.0.0.dev2.dist-info/RECORD +19 -0
- hishel-1.0.0.dev0.dist-info/RECORD +0 -19
- {hishel-1.0.0.dev0.dist-info → hishel-1.0.0.dev2.dist-info}/WHEEL +0 -0
- {hishel-1.0.0.dev0.dist-info → hishel-1.0.0.dev2.dist-info}/licenses/LICENSE +0 -0
hishel/_async_cache.py
CHANGED
|
@@ -25,7 +25,7 @@ from hishel import (
|
|
|
25
25
|
create_idle_state,
|
|
26
26
|
)
|
|
27
27
|
from hishel._core._spec import InvalidatePairs, vary_headers_match
|
|
28
|
-
from hishel._core.models import CompletePair
|
|
28
|
+
from hishel._core.models import CompletePair, ResponseMetadata
|
|
29
29
|
|
|
30
30
|
logger = logging.getLogger("hishel.integrations.clients")
|
|
31
31
|
|
|
@@ -90,7 +90,14 @@ class AsyncCacheProxy:
|
|
|
90
90
|
logger.debug(
|
|
91
91
|
"Found matching cached response for the request",
|
|
92
92
|
)
|
|
93
|
-
|
|
93
|
+
response_meta = ResponseMetadata(
|
|
94
|
+
hishel_spec_ignored=True,
|
|
95
|
+
hishel_from_cache=True,
|
|
96
|
+
hishel_created_at=pair.meta.created_at,
|
|
97
|
+
hishel_revalidated=False,
|
|
98
|
+
hishel_stored=False,
|
|
99
|
+
)
|
|
100
|
+
pair.response.metadata.update(response_meta) # type: ignore
|
|
94
101
|
await self._maybe_refresh_pair_ttl(pair)
|
|
95
102
|
return pair.response
|
|
96
103
|
|