Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions libmozevent/pulse.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,17 @@ async def create_pulse_listener(
# pulse but something we started doing in release services
queue = f"queue/{user}/exchange/{exchange_name}"

await channel.queue_declare(queue_name=queue, durable=True)
await channel.queue_declare(queue_name=queue, durable=True, auto_delete=True)

# in case we are going to listen to an exchange that is specific for this
# user, we need to ensure that exchange exists before first message is
# sent (this is what creates exchange)
if exchange.startswith(f"exchange/{user}/"):
await channel.exchange_declare(
exchange_name=exchange, type_name="topic", durable=True
exchange_name=exchange,
type_name="topic",
durable=True,
auto_delete=True,
)

for topic in topics:
Expand Down