mirror of
https://github.com/Significant-Gravitas/AutoGPT.git
synced 2026-04-08 03:00:28 -04:00
feat(backend): expose the expiration for rabbitmq publish
This commit is contained in:
@@ -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,
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user