docs(code): add concise docstrings

This commit is contained in:
2026-07-14 11:05:07 +03:30
parent c54f6edc1e
commit 5f88e964f6
20 changed files with 299 additions and 26 deletions

View File

@@ -27,6 +27,8 @@ async def handle_message(
exchange: Any,
dlx: Any,
) -> None:
"""Process one SMS job, retry bounded failures, and dead-letter permanent failures."""
async with message.process(ignore_processed=True, requeue=False):
payload = json.loads(message.body.decode())
job = SmsJob(**payload)
@@ -48,6 +50,7 @@ async def handle_message(
)
return
# Re-publish instead of requeueing indefinitely so retries remain bounded.
logger.warning(
"SMS job failed for mobile=%s retry=%s", job.mobile, retry_count + 1, exc_info=True
)
@@ -63,6 +66,8 @@ async def handle_message(
async def main() -> None:
"""Start the RabbitMQ consumer and bind it to the configured SMS strategy."""
logging.basicConfig(level=logging.INFO)
settings = get_settings()
connection = await connect_robust(settings.rabbitmq_url)