mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 11:52:01 +00:00
Delay queue creation if we're not connected in the TornadoQueueClient
(imported from commit c583693783322136927ae1a1018a61b2ffa6597f)
This commit is contained in:
@@ -151,8 +151,13 @@ class TornadoQueueClient(SimpleQueueClient):
|
||||
callback()
|
||||
|
||||
if queue_name not in self.queues:
|
||||
self.channel.queue_declare(queue=queue_name, durable=True,
|
||||
callback=finish)
|
||||
# If we're not connected yet, send this message
|
||||
# once we have created the channel
|
||||
if not self.ready():
|
||||
self._on_open_cbs.append(lambda: self.ensure_queue(queue_name, callback))
|
||||
return
|
||||
|
||||
self.channel.queue_declare(queue=queue_name, durable=True, callback=finish)
|
||||
else:
|
||||
callback()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user