mirror of
https://github.com/flibusta-apps/telegram_files_cache_server.git
synced 2025-12-06 14:45:36 +01:00
Add sentry
This commit is contained in:
@@ -48,7 +48,7 @@ async def check_books_page(ctx, page_number: int) -> None:
|
||||
)
|
||||
|
||||
|
||||
async def check_books(ctx: dict, *args, **kwargs) -> None:
|
||||
async def check_books(ctx: dict, *args, **kwargs) -> None: # NOSONAR
|
||||
arq_pool: ArqRedis = ctx["arc_pool"]
|
||||
try:
|
||||
books_page = await get_books(1, PAGE_SIZE)
|
||||
@@ -89,7 +89,7 @@ async def cache_file(book: Book, file_type: str) -> Optional[CachedFile]:
|
||||
|
||||
|
||||
async def cache_file_by_book_id(
|
||||
ctx: dict,
|
||||
ctx: dict, # NOSONAR
|
||||
book_id: int,
|
||||
file_type: str,
|
||||
by_request: bool = True,
|
||||
|
||||
@@ -6,6 +6,7 @@ from prometheus_fastapi_instrumentator import Instrumentator
|
||||
from app.views import router, healthcheck_router
|
||||
from core.arq_pool import get_arq_pool
|
||||
from core.db import database
|
||||
import core.sentry # noqa: F401
|
||||
|
||||
|
||||
def start_app() -> FastAPI:
|
||||
|
||||
@@ -23,5 +23,7 @@ class EnvConfig(BaseSettings):
|
||||
REDIS_PORT: int
|
||||
REDIS_DB: int
|
||||
|
||||
SENTRY_SDN: str
|
||||
|
||||
|
||||
env_config = EnvConfig()
|
||||
|
||||
8
src/core/sentry.py
Normal file
8
src/core/sentry.py
Normal file
@@ -0,0 +1,8 @@
|
||||
import sentry_sdk
|
||||
|
||||
from core.config import env_config
|
||||
|
||||
|
||||
sentry_sdk.init(
|
||||
env_config.SENTRY_SDN,
|
||||
)
|
||||
@@ -7,6 +7,7 @@ from app.services.cache_updater import (
|
||||
)
|
||||
from core.arq_pool import get_redis_settings, get_arq_pool
|
||||
from core.db import database
|
||||
import core.sentry # noqa: F401
|
||||
|
||||
|
||||
async def startup(ctx):
|
||||
|
||||
Reference in New Issue
Block a user