redis & listening works!!
This commit is contained in:
@ -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"}
|
||||
|
||||
Reference in New Issue
Block a user