Comments (4)
Can you show a small reproducible code example?
from cashews.
I cannot share the actual code because it's a sensitive application. But I can show an example endpoint with the decorator:
@router.get("/test/{id}/", response_model=Page)
@cache(
ttl="5m",
key="test-plans-id:{id}-{params}",
)
async def read_test_plans(
*,
params: Params = Depends(),
id: int,
) -> Any:
"""
Fetch a list of Venue Plans.
"""
return Page(data=["test1", "test2"], metadata=MetaData(number_of_results=2))
The cache is setup as in my original post.
Here is a larger stack trace too:
File /code/.venv/lib/python3.10/site-packages/cashews/wrapper/decorators.py, line 56, in _call
File /code/.venv/lib/python3.10/site-packages/cashews/decorators/locked.py, line 96, in _wrapper
File /code/.venv/lib/python3.10/site-packages/cashews/decorators/cache/simple.py, line 51, in _wrap
File /code/.venv/lib/python3.10/site-packages/cashews/wrapper/commands.py, line 31, in get
File /code/./app/caching.py, line 19, in logging_middleware
File /code/.venv/lib/python3.10/site-packages/cashews/wrapper/disable_control.py, line 18, in _is_disable_middleware
File /code/.venv/lib/python3.10/site-packages/cashews/validation.py, line 84, in _invalidate_middleware
File /code/.venv/lib/python3.10/site-packages/cashews/wrapper/auto_init.py, line 18, in _auto_init
File /code/.venv/lib/python3.10/site-packages/cashews/backends/redis/client_side.py, line 80, in init
File /code/.venv/lib/python3.10/site-packages/cashews/backends/redis/client_side.py, line 97, in _listen_invalidate_forever
File /code/.venv/lib/python3.10/site-packages/cashews/backends/redis/client_side.py, line 118, in _listen_invalidate
File /code/.venv/lib/python3.10/site-packages/cashews/backends/redis/client_side.py, line 110, in _get_channel
from cashews.
Hi @lineup-tk thanks for reporting this issue.
Unfortunately I can't reproduce this issue, please provide more information about your env - output of pip freeze
and python -V
from cashews.
I closed this issue, fill free to reopen it with more details about your env
from cashews.
Related Issues (20)
- Cannot close Redis connection - AttributeError: 'Redis' object has no attribute '_client' HOT 4
- Cache doesn't work with GZIPMiddleware HOT 5
- JSON serializer HOT 6
- Early cache with sqlalchemy & fastapi depend (sqlalchemy.exc.IllegalStateChangeError: Method 'close()' can't be called here; method '_connection_for_bind()' is already in progress and this would cause an unexpected state change to <SessionTransactionState.CLOSED: 5>) HOT 1
- Formatter Called with Formatted Value HOT 9
- CacheRequestControlMiddleware: Backend not found exception with non-default cache prefix HOT 3
- cache_control_ttl can't be used directly with cache api HOT 1
- thunder_protection with multiple event loops breaks HOT 3
- re.error: bad character in group name when using custom formatter in a tag HOT 3
- Unhandled exception when there are only backends with prefixes HOT 2
- Feature: Get or set HOT 1
- _empty and _empty_in_redis marker objects leak HOT 1
- Redis Client Side Connection Timeout HOT 7
- Interrupted `StreamingResponse` will cache partial response HOT 3
- The `add_prefix` middleware didn't consider `delete_many` HOT 1
- Problem with codecov
- valkeys backend HOT 1
- Early caching unexpected behavior: Altered keys breaking other api calls HOT 10
- TypeError: cannot pickle 'coroutine' object when using async def as default argument in get_or_set HOT 3
- Performance issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from cashews.