docs(code): add concise docstrings
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user