feat(demo): add auth flow UI service
This commit is contained in:
@@ -5,6 +5,7 @@ from typing import Any, cast
|
||||
|
||||
import aio_pika
|
||||
from aio_pika.abc import AbstractIncomingMessage
|
||||
from redis.asyncio import Redis
|
||||
|
||||
from gapido_auth.config import get_settings
|
||||
from gapido_auth.domain.entities import SmsJob
|
||||
@@ -69,10 +70,14 @@ async def main() -> None:
|
||||
channel = await connection.channel()
|
||||
await channel.set_qos(prefetch_count=20)
|
||||
exchange, queue, dlx = await declare_sms_topology(channel)
|
||||
client = create_sms_client(settings)
|
||||
await queue.consume(lambda message: handle_message(message, client, exchange, dlx))
|
||||
logger.info("SMS worker started with provider=%s", settings.sms_provider)
|
||||
await asyncio.Future()
|
||||
redis = Redis.from_url(settings.redis_url, decode_responses=True)
|
||||
try:
|
||||
client = create_sms_client(settings, debug_store=redis)
|
||||
await queue.consume(lambda message: handle_message(message, client, exchange, dlx))
|
||||
logger.info("SMS worker started with provider=%s", settings.sms_provider)
|
||||
await asyncio.Future()
|
||||
finally:
|
||||
await redis.aclose()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
Reference in New Issue
Block a user