mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2025-12-06 14:45:36 +01:00
Fix lint
This commit is contained in:
@@ -6,9 +6,10 @@ import random
|
||||
from tempfile import SpooledTemporaryFile
|
||||
from typing import Optional, cast
|
||||
|
||||
from fastapi import UploadFile
|
||||
|
||||
from arq.connections import ArqRedis
|
||||
from arq.worker import Retry
|
||||
from fastapi import UploadFile
|
||||
import httpx
|
||||
from redis import asyncio as aioredis
|
||||
from redis.exceptions import LockError
|
||||
@@ -19,6 +20,7 @@ from app.services.downloader import download
|
||||
from app.services.files_client import upload_file
|
||||
from app.services.library_client import Book, get_book, get_books, get_last_book_id
|
||||
|
||||
|
||||
logger = logging.getLogger("telegram_channel_files_manager")
|
||||
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@ from sentry_sdk import capture_exception
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
|
||||
@@ -1,10 +1,12 @@
|
||||
from base64 import b64encode
|
||||
|
||||
from arq.connections import ArqRedis
|
||||
from fastapi import APIRouter, Depends, HTTPException, Request, status
|
||||
from fastapi.responses import StreamingResponse
|
||||
|
||||
from starlette.background import BackgroundTask
|
||||
|
||||
from arq.connections import ArqRedis
|
||||
|
||||
from app.depends import check_token
|
||||
from app.models import CachedFile as CachedFileDB
|
||||
from app.serializers import CachedFile, CreateCachedFile
|
||||
@@ -15,6 +17,7 @@ from app.services.files_client import download_file as download_file_from_cache
|
||||
from app.services.library_client import get_book
|
||||
from app.utils import get_cached_file_or_cache
|
||||
|
||||
|
||||
router = APIRouter(
|
||||
prefix="/api/v1", tags=["files"], dependencies=[Depends(check_token)]
|
||||
)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
from fastapi import FastAPI
|
||||
from fastapi.responses import ORJSONResponse
|
||||
|
||||
from prometheus_fastapi_instrumentator import Instrumentator
|
||||
|
||||
from app.views import healthcheck_router, router
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from fastapi.security import APIKeyHeader
|
||||
|
||||
|
||||
default_security = APIKeyHeader(name="Authorization")
|
||||
|
||||
@@ -5,6 +5,7 @@ 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,6 +2,7 @@ import sentry_sdk
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
sentry_sdk.init(
|
||||
env_config.SENTRY_DSN,
|
||||
)
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from core.app import start_app
|
||||
|
||||
|
||||
app = start_app()
|
||||
|
||||
Reference in New Issue
Block a user