1+ from contextlib import asynccontextmanager
2+
13import asyncpg
2- from apscheduler . eventbrokers . redis import RedisEventBroker
4+ from apscheduler import AsyncScheduler
35from apscheduler .datastores .sqlalchemy import SQLAlchemyDataStore
4- from fastapi import FastAPI , Depends
5- from fastapi_cache import FastAPICache
6- from fastapi_cache .backends .redis import RedisBackend
6+ from apscheduler .eventbrokers .redis import RedisEventBroker
7+ from fastapi import Depends , FastAPI
78
9+ from app .api .health import router as health_router
810from app .api .nonsense import router as nonsense_router
911from app .api .shakespeare import router as shakespeare_router
1012from app .api .stuff import router as stuff_router
13+ from app .api .user import router as user_router
1114from app .config import settings as global_settings
1215from app .database import engine
13- from app .utils .logging import AppLogger
14- from app .api .user import router as user_router
15- from app .api .health import router as health_router
16- from app .redis import get_redis , get_cache
16+ from app .redis import get_redis
1717from app .services .auth import AuthBearer
1818from app .services .scheduler import SchedulerMiddleware
19-
20- from contextlib import asynccontextmanager
21-
22- from apscheduler import AsyncScheduler
19+ from app .utils .logging import AppLogger
2320
2421logger = AppLogger ().get_logger ()
2522
@@ -32,10 +29,7 @@ async def lifespan(_app: FastAPI):
3229 _postgres_dsn = global_settings .postgres_url .unicode_string ()
3330
3431 try :
35- # Initialize the cache with the redis connection
36- redis_cache = await get_cache ()
37- FastAPICache .init (RedisBackend (redis_cache ), prefix = "fastapi-cache" )
38- # logger.info(FastAPICache.get_cache_status_header())
32+ # TODO: cache with the redis connection
3933 # Initialize the postgres connection pool
4034 _app .postgres_pool = await asyncpg .create_pool (
4135 dsn = _postgres_dsn ,
0 commit comments