amo-server/workers/middleware.py
Maxim Snesarev 33d6bb7ebd Refactor AMO CRM Data Collection Service to use PostgreSQL
- Updated database configuration to switch from SQLite to PostgreSQL, including changes to alembic.ini, Docker Compose, and environment settings.
- Refactored application code to utilize PostgreSQL database adapters, ensuring compatibility with the new database structure.
- Enhanced API routes and data handling to support the new database, including adjustments in data models and query logic.
- Introduced new job processing mechanisms for full synchronization of AMO CRM entities, leveraging FastStream for background tasks.
- Improved logging and error handling across the application to facilitate better monitoring and debugging.
- Removed obsolete SQLite adapter files and migrations, streamlining the project structure for PostgreSQL integration.
2025-11-05 00:38:37 +03:00

25 lines
661 B
Python

"""
FastStream middleware for observability and error handling.
This module provides middleware for adding metrics, tracing, and
enhanced error handling to FastStream message processing.
"""
import logging
from typing import Any, Awaitable, Callable
logger = logging.getLogger(__name__)
def setup_middleware(broker):
"""
Set up all middleware for the FastStream broker.
Args:
broker: FastStream Redis broker instance
Note: Middleware setup is simplified for compatibility.
Can be enhanced with custom middleware implementations as needed.
"""
logger.info("FastStream broker configured (middleware setup placeholder)")