Skip to content

Commit

Permalink
arreglar redis
Browse files Browse the repository at this point in the history
  • Loading branch information
kovaxis committed Jun 18, 2024
1 parent 6e20401 commit 9f4f952
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
9 changes: 5 additions & 4 deletions backend/app/redis.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
import contextlib
from typing import Any

from app.settings import settings
from redis.asyncio import ConnectionPool, Redis

from app.settings import settings


def init_redis_pool() -> ConnectionPool[Any]:
def init_redis_pool() -> ConnectionPool: # type: ignore
return ConnectionPool.from_url( # type: ignore
settings.redis_uri,
decode_responses=True,
encoding="utf-8",
)


connection_pool = init_redis_pool()
connection_pool = init_redis_pool() # type: ignore


@contextlib.asynccontextmanager
Expand All @@ -24,7 +25,7 @@ async def get_redis():
Use with `async with` in order to close the connection at the end of the scope.
"""
redis: Redis[Any] = Redis(
connection_pool=connection_pool,
connection_pool=connection_pool, # type: ignore
auto_close_connection_pool=False,
decode_responses=True,
encoding="utf-8",
Expand Down
4 changes: 4 additions & 0 deletions justfile
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ db-generate:
@echo "{{ info_prefix }} \e[1mGenerating Prisma client...\e[0m"
cd backend && poetry run prisma generate

run:
@echo "{{ info_prefix }} \e[1mRunning backend + frontend + CAS mock\e[0m"
(npx --yes cas-server-mock --database=$PWD/cas-mock/data/cas-mock-users.json) & (cd frontend && npm run dev) & (cd backend && poetry run uvicorn app.main:app) && fg

set positional-arguments := true
default_environment := "development"
deploy environment=default_environment:
Expand Down

0 comments on commit 9f4f952

Please sign in to comment.