mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
bug fix
This commit is contained in:
2
Makefile
2
Makefile
@@ -32,7 +32,7 @@ check: deps
|
||||
test: deps
|
||||
$(py_warn) pytest
|
||||
|
||||
build: deps
|
||||
build: clean deps
|
||||
@poetry build
|
||||
|
||||
clean:
|
||||
|
||||
@@ -34,7 +34,10 @@ def cache(
|
||||
expire = expire or FastAPICache.get_expire()
|
||||
key_builder = key_builder or FastAPICache.get_key_builder()
|
||||
backend = FastAPICache.get_backend()
|
||||
cache_key = key_builder(func, namespace, args=args, kwargs=kwargs)
|
||||
copy_kwargs = kwargs.copy()
|
||||
copy_kwargs.pop("request", None)
|
||||
copy_kwargs.pop("response", None)
|
||||
cache_key = key_builder(func, namespace, args=args, kwargs=copy_kwargs)
|
||||
ttl, ret = await backend.get_with_ttl(cache_key)
|
||||
if not request:
|
||||
if ret is not None:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "fastapi-cache2"
|
||||
version = "0.1.3.2"
|
||||
version = "0.1.3.3"
|
||||
description = "Cache for FastAPI"
|
||||
authors = ["long2ice <long2ice@gmail.com>"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
Reference in New Issue
Block a user