feat(backend): expose the expiration for rabbitmq publish

This commit is contained in:
Nicholas Tindle
2025-02-10 15:16:41 -06:00
parent 61d180ae3b
commit 3f813c09a9

View File

@@ -1,3 +1,4 @@
from datetime import timedelta
import logging
from abc import ABC, abstractmethod
from enum import Enum
@@ -262,6 +263,7 @@ class AsyncRabbitMQ(RabbitMQBase):
self,
routing_key: str,
message: str,
expiration: Optional[timedelta] = None,
exchange: Optional[Exchange] = None,
persistent: bool = True,
) -> None:
@@ -284,6 +286,7 @@ class AsyncRabbitMQ(RabbitMQBase):
if persistent
else aio_pika.DeliveryMode.NOT_PERSISTENT
),
expiration=expiration if expiration else None,
),
routing_key=routing_key,
)