mirror of
https://github.com/grillazz/fastapi-sqlalchemy-asyncpg.git
synced 2025-11-30 13:20:40 +03:00
fix lint error
This commit is contained in:
@@ -5,8 +5,6 @@ from apscheduler import AsyncScheduler
|
||||
from apscheduler.datastores.sqlalchemy import SQLAlchemyDataStore
|
||||
from apscheduler.eventbrokers.redis import RedisEventBroker
|
||||
from fastapi import Depends, FastAPI
|
||||
from fastapi_cache import FastAPICache
|
||||
from fastapi_cache.backends.redis import RedisBackend
|
||||
|
||||
from app.api.health import router as health_router
|
||||
from app.api.nonsense import router as nonsense_router
|
||||
@@ -15,7 +13,7 @@ from app.api.stuff import router as stuff_router
|
||||
from app.api.user import router as user_router
|
||||
from app.config import settings as global_settings
|
||||
from app.database import engine
|
||||
from app.redis import get_cache, get_redis
|
||||
from app.redis import get_redis
|
||||
from app.services.auth import AuthBearer
|
||||
from app.services.scheduler import SchedulerMiddleware
|
||||
from app.utils.logging import AppLogger
|
||||
@@ -31,10 +29,7 @@ async def lifespan(_app: FastAPI):
|
||||
_postgres_dsn = global_settings.postgres_url.unicode_string()
|
||||
|
||||
try:
|
||||
# Initialize the cache with the redis connection
|
||||
redis_cache = await get_cache()
|
||||
FastAPICache.init(RedisBackend(redis_cache), prefix="fastapi-cache")
|
||||
# logger.info(FastAPICache.get_cache_status_header())
|
||||
# TODO: cache with the redis connection
|
||||
# Initialize the postgres connection pool
|
||||
_app.postgres_pool = await asyncpg.create_pool(
|
||||
dsn=_postgres_dsn,
|
||||
|
||||
Reference in New Issue
Block a user