Added Ruff linting
This commit is contained in:
1 parent
a96c6db97d
commit
fa9eb3d323
6 files changed
+57
-23
No files matched your search
+13
-11
@@ -1,14 +1,16 @@
|
||||
from fastapi import FastAPI, Depends, HTTPException, Response, Request
|
||||
import uvicorn
|
||||
from contextlib import asynccontextmanager
|
||||
from db_module import get_db, create_connection_pool, close_connection_pool, start_healthcheck_thread
|
||||
from simple_logger_handler import setup_logger, LOG_LEVEL
|
||||
from feed_handler import grab_latest_chapter_information
|
||||
from send_notification import send_notification
|
||||
from metrics_server import REQUEST_COUNTER
|
||||
import asyncio
|
||||
from uvicorn_logger_config import LOGGING_CONFIG
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import uvicorn
|
||||
from fastapi import Depends, FastAPI, HTTPException, Request
|
||||
|
||||
from db_module import close_connection_pool, create_connection_pool, get_db, start_healthcheck_thread
|
||||
from feed_handler import grab_latest_chapter_information
|
||||
from metrics_server import REQUEST_COUNTER
|
||||
from secret_manager import cleanup_secret_files
|
||||
from send_notification import send_notification
|
||||
from simple_logger_handler import LOG_LEVEL, setup_logger
|
||||
from uvicorn_logger_config import LOGGING_CONFIG
|
||||
|
||||
logger = setup_logger(__name__)
|
||||
|
||||
@@ -95,11 +97,11 @@ def get_chapters(request: Request, db = Depends(get_db)):
|
||||
return {"status": "checked"}
|
||||
except ValueError as e:
|
||||
logger.error(f"[Royalroad] Failed to fetch feed {royalroadId}: {e}")
|
||||
raise HTTPException(status_code=404, detail=str(e))
|
||||
raise HTTPException(status_code=404, detail=str(e)) from e
|
||||
|
||||
except Exception as e:
|
||||
logger.error(f"[Royalroad] Error during chapter check: {e}", exc_info=True)
|
||||
raise HTTPException(status_code=500, detail=str(e))
|
||||
raise HTTPException(status_code=500, detail=str(e)) from e
|
||||
|
||||
async def start_servers():
|
||||
logger.info("[Server] Starting main API (port 5000) and metrics server (port 9000)...")
|
||||
|
||||
Reference in new issue
Block a user