mirror of
https://github.com/zulip/zulip.git
synced 2025-11-16 20:02:15 +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()
|
callback()
|
||||||
|
|
||||||
if queue_name not in self.queues:
|
if queue_name not in self.queues:
|
||||||
self.channel.queue_declare(queue=queue_name, durable=True,
|
# If we're not connected yet, send this message
|
||||||
callback=finish)
|
# 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:
|
else:
|
||||||
callback()
|
callback()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user