mirror of
https://github.com/long2ice/fastapi-cache.git
synced 2026-03-24 20:47:54 +00:00
chore: set version 0.2.0
This commit is contained in:
@@ -2,8 +2,10 @@
|
||||
|
||||
## 0.2
|
||||
|
||||
### 0.2.1
|
||||
### 0.2.0
|
||||
|
||||
- Make `request` and `response` optional.
|
||||
- Add typing info to the `cache` decorator.
|
||||
- Support cache jinja2 template response.
|
||||
- Support cache `JSONResponse`
|
||||
- Add `py.typed` file and type hints
|
||||
@@ -11,11 +13,6 @@
|
||||
- Fix cache decorate sync function
|
||||
- Transparently handle backend connection failures.
|
||||
|
||||
### 0.2.0
|
||||
|
||||
- Make `request` and `response` optional.
|
||||
- Add typing info to the `cache` decorator.
|
||||
|
||||
## 0.1
|
||||
|
||||
### 0.1.10
|
||||
|
||||
@@ -2,7 +2,7 @@ import pendulum
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from starlette.requests import Request
|
||||
from starlette.responses import Response, JSONResponse
|
||||
from starlette.responses import JSONResponse, Response
|
||||
|
||||
from fastapi_cache import FastAPICache
|
||||
from fastapi_cache.backends.inmemory import InMemoryBackend
|
||||
|
||||
@@ -4,13 +4,12 @@ import pendulum
|
||||
import redis.asyncio as redis
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
from starlette.responses import JSONResponse
|
||||
from fastapi.responses import HTMLResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from fastapi.templating import Jinja2Templates
|
||||
from redis.asyncio.connection import ConnectionPool
|
||||
from starlette.requests import Request
|
||||
from starlette.responses import Response
|
||||
from starlette.responses import JSONResponse, Response
|
||||
|
||||
from fastapi_cache import FastAPICache
|
||||
from fastapi_cache.backends.redis import RedisBackend
|
||||
|
||||
@@ -132,7 +132,9 @@ def cache(
|
||||
return coder.decode(ret)
|
||||
ret = await ensure_async_func(*args, **kwargs)
|
||||
try:
|
||||
await backend.set(cache_key, coder.encode(ret), expire or FastAPICache.get_expire())
|
||||
await backend.set(
|
||||
cache_key, coder.encode(ret), expire or FastAPICache.get_expire()
|
||||
)
|
||||
except ConnectionError:
|
||||
pass
|
||||
return ret
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[tool.poetry]
|
||||
name = "fastapi-cache2"
|
||||
version = "0.2.1"
|
||||
version = "0.2.0"
|
||||
description = "Cache for FastAPI"
|
||||
authors = ["long2ice <long2ice@gmail.com>"]
|
||||
license = "Apache-2.0"
|
||||
@@ -23,7 +23,7 @@ aiomcache = { version = "*", optional = true }
|
||||
pendulum = "*"
|
||||
aiobotocore = { version = "^1.4.1", optional = true }
|
||||
typing-extensions = { version = ">=4.1.0", markers = "python_version < \"3.10\"" }
|
||||
aiohttp= { version = ">=3.8.3", markers = "python_version >= \"3.11\""}
|
||||
aiohttp = { version = ">=3.8.3", markers = "python_version >= \"3.11\"" }
|
||||
|
||||
[tool.poetry.dev-dependencies]
|
||||
flake8 = "*"
|
||||
|
||||
Reference in New Issue
Block a user