Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Passing username to Redis in decorators #758

Closed
lainiwa opened this issue Aug 30, 2023 · 1 comment
Closed

Passing username to Redis in decorators #758

lainiwa opened this issue Aug 30, 2023 · 1 comment

Comments

@lainiwa
Copy link

lainiwa commented Aug 30, 2023

Hello!
What is the recommended way of passing a username to the @cached decorator with Redis backend?
Currently the decorator takes the password, but doesn't allow the username.
Is it intentionally designed that way?

Things I tried:

@cached(
    cache=Cache.REDIS,
    username=...  # <-- NOT ALLOWED
    password=...
)
async def f(n):

and

import redis.asyncio as redis

@cached(
    cache=Cache.REDIS,
    client=redis.Redis(username=..., password=...)  # <-- NOT ALLOWED
)
async def f(n):
@Dreamsorcerer
Copy link
Member

v1 will just accept the cache object itself, instead of having all those parameters.

See #609

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants