diff --git a/app_bot/bot/core/tasks/upload.py b/app_bot/bot/core/tasks/upload.py index 617e95c..e6c9d76 100644 --- a/app_bot/bot/core/tasks/upload.py +++ b/app_bot/bot/core/tasks/upload.py @@ -180,10 +180,9 @@ class AbstractUploadTask(AbstractTask, ABC): ) async for db in get_db(): - await TaskRepository().save_file_cache( + await TaskRepository(session=db).save_file_cache( cache=cache, file_id=self._media_object.orm_file_id, - db=db, ) diff --git a/app_worker/worker/core/callbacks.py b/app_worker/worker/core/callbacks.py index 22d0e85..c1bfa45 100644 --- a/app_worker/worker/core/callbacks.py +++ b/app_worker/worker/core/callbacks.py @@ -3,7 +3,7 @@ import logging from aio_pika import IncomingMessage from yt_shared.schemas.media import InbMediaPayload -from worker.core.payload_handler import PayloadHandler +from worker.core.payload_handler import InboundPayloadHandler class RMQCallbacks: @@ -11,7 +11,7 @@ class RMQCallbacks: def __init__(self) -> None: self._log = logging.getLogger(self.__class__.__name__) - self._payload_handler = PayloadHandler() + self._payload_handler = InboundPayloadHandler() async def on_input_message(self, message: IncomingMessage) -> None: try: diff --git a/app_worker/worker/core/payload_handler.py b/app_worker/worker/core/payload_handler.py index a66a587..040d4e3 100644 --- a/app_worker/worker/core/payload_handler.py +++ b/app_worker/worker/core/payload_handler.py @@ -15,7 +15,7 @@ from worker.core.exceptions import DownloadVideoServiceError, GeneralVideoServic from worker.core.media_service import MediaService -class PayloadHandler: +class InboundPayloadHandler: def __init__(self) -> None: self._log = logging.getLogger(self.__class__.__name__) self._rmq_publisher = RmqPublisher()