chore: set version 0.2.0

This commit is contained in:
long2ice
2023-01-11 21:20:41 +08:00
parent 09361a7d4f
commit 59a47b7fae
5 changed files with 10 additions and 12 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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"