diff --git a/src/app/services/updaters/fl_updater.py b/src/app/services/updaters/fl_updater.py index 4315bff..ae1ac45 100644 --- a/src/app/services/updaters/fl_updater.py +++ b/src/app/services/updaters/fl_updater.py @@ -6,7 +6,6 @@ import aiomysql import asyncpg from app.services.updaters.base import BaseUpdater -from app.services.webhook import WebhookSender from core.config import env_config @@ -705,8 +704,6 @@ class FlUpdater(BaseUpdater): self._update_books_genres(), ) - await WebhookSender.send() - return True @classmethod diff --git a/src/app/services/webhook.py b/src/app/services/webhook.py deleted file mode 100644 index 1ef53d6..0000000 --- a/src/app/services/webhook.py +++ /dev/null @@ -1,23 +0,0 @@ -import httpx - -from core.config import env_config, WebhookConfig - - -class WebhookSender: - @classmethod - async def _make_request(cls, webhook: WebhookConfig): - print(f"Make request to {webhook.url}") - - async with httpx.AsyncClient() as client: - request_maker = getattr(client, webhook.method) - await request_maker(webhook.url, headers=webhook.headers) - - @classmethod - async def send(cls): - webhooks = env_config.WEBHOOKS - - if webhooks is None: - return - - for webhook in webhooks: - await cls._make_request(webhook) diff --git a/src/core/config.py b/src/core/config.py index 34c2176..9dcc632 100644 --- a/src/core/config.py +++ b/src/core/config.py @@ -1,4 +1,4 @@ -from typing import Optional, Union, Literal +from typing import Union, Literal from pydantic import BaseModel, BaseSettings @@ -26,7 +26,5 @@ class EnvConfig(BaseSettings): FL_BASE_URL: str - WEBHOOKS: Optional[list[WebhookConfig]] - env_config = EnvConfig()