This commit is contained in:
long2ice
2022-11-07 16:39:17 +08:00
parent 91e6e51ec7
commit 8f0920d0d7
10 changed files with 21 additions and 22 deletions

View File

@@ -1,7 +1,7 @@
import inspect
import sys
from functools import wraps
from typing import Any, Awaitable, Callable, Optional, TypeVar, Type
from typing import Any, Awaitable, Callable, Optional, Type, TypeVar
if sys.version_info >= (3, 10):
from typing import ParamSpec
@@ -15,7 +15,6 @@ from starlette.responses import Response
from fastapi_cache import FastAPICache
from fastapi_cache.coder import Coder
P = ParamSpec("P")
R = TypeVar("R")
@@ -113,7 +112,7 @@ def cache(
request=request,
response=response,
args=args,
kwargs=copy_kwargs
kwargs=copy_kwargs,
)
else:
cache_key = key_builder(
@@ -122,7 +121,7 @@ def cache(
request=request,
response=response,
args=args,
kwargs=copy_kwargs
kwargs=copy_kwargs,
)
ttl, ret = await backend.get_with_ttl(cache_key)