mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2025-12-06 14:45:36 +01:00
Migrate to ruff
This commit is contained in:
@@ -1,13 +1,12 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import ORJSONResponse
|
||||
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
|
||||
from app.views import router, healthcheck_router
|
||||
import core.sentry # noqa: F401
|
||||
from app.views import healthcheck_router, router
|
||||
from core.arq_pool import get_arq_pool
|
||||
from core.db import database
|
||||
from core.redis_client import get_client
|
||||
import core.sentry # noqa: F401
|
||||
|
||||
|
||||
def start_app() -> FastAPI:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
from arq.connections import create_pool, RedisSettings, ArqRedis
|
||||
import msgpack
|
||||
from arq.connections import ArqRedis, RedisSettings, create_pool
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
from fastapi.security import APIKeyHeader
|
||||
|
||||
|
||||
default_security = APIKeyHeader(name="Authorization")
|
||||
|
||||
@@ -5,7 +5,6 @@ from sqlalchemy import MetaData
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
DATABASE_URL = (
|
||||
f"postgresql://{env_config.POSTGRES_USER}:{quote(env_config.POSTGRES_PASSWORD)}@"
|
||||
f"{env_config.POSTGRES_HOST}:{env_config.POSTGRES_PORT}/{env_config.POSTGRES_DB}"
|
||||
|
||||
@@ -2,7 +2,6 @@ import sentry_sdk
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
sentry_sdk.init(
|
||||
env_config.SENTRY_DSN,
|
||||
)
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import msgpack
|
||||
|
||||
import core.sentry # noqa: F401
|
||||
from app.services.cache_updater import (
|
||||
check_books,
|
||||
cache_file_by_book_id,
|
||||
check_books,
|
||||
check_books_page,
|
||||
)
|
||||
from core.arq_pool import get_redis_settings, get_arq_pool
|
||||
from core.arq_pool import get_arq_pool, get_redis_settings
|
||||
from core.db import database
|
||||
from core.redis_client import get_client
|
||||
import core.sentry # noqa: F401
|
||||
|
||||
|
||||
async def startup(ctx):
|
||||
|
||||
Reference in New Issue
Block a user