redis & listening works!!

This commit is contained in:
2024-05-10 15:11:25 +03:00
parent 2a696f96c1
commit 0ebfd11851
10 changed files with 105 additions and 14 deletions

View File

@ -1,8 +1,10 @@
from typing import Union
from typing import Union, Annotated
from fastapi import FastAPI, Depends
import redis
from .db import models
from .db.database import SessionLocal, engine
from .db.redis import create_redis
from .dependencies import get_db
from .views.auth.api import router as auth_router
@ -17,6 +19,12 @@ app.include_router(auth_router)
app.include_router(news_router)
@app.on_event("startup")
async def startup_event():
r = await create_redis()
await r.flushall()
@app.get("/")
async def read_root():
return {"message": "OK"}