import logging.config from typing import Any import sentry_sdk from anydi import auto from sentry_sdk.integrations.aws_lambda import AwsLambdaIntegration from sentry_sdk.integrations.httpx import HttpxIntegration from app.config import settings from app.container import container from app.handler import TwilioSendMessagesHandler # Configure logging logging.config.dictConfig(settings.logging_config) # Setup Sentry if settings.sentry_dsn: sentry_sdk.init( dsn=settings.sentry_dsn, environment=settings.environment, integrations=[ AwsLambdaIntegration(), HttpxIntegration(), ], ) # Get the logger logger = logging.getLogger(__name__) @container.inject def handle( _event: Any, _context: Any, handler: TwilioSendMessagesHandler = auto ) -> Any: """Handle the event.""" logger.info("Scheduled event received.") handler.handle() return {"status": "OK"}