mirror of
https://github.com/zulip/zulip.git
synced 2025-11-06 06:53:25 +00:00
queue: Use normal instance data in SimpleQueue
Code like this is dangerous:
class SimpleQueue(object):
queues = set()
because all instances will share the same 'queues' set object.
We don't really need multiple instances, but neither is there a reason to break
them. So do the normal Python thing instead.
(imported from commit a56bb8414dd549cfd312c9565df198cf9d20f08a)
This commit is contained in:
@@ -7,13 +7,11 @@ import simplejson
|
||||
# interface for external files to put things into queues and take them
|
||||
# out from bots without having to import pika code all over our codebase.
|
||||
class SimpleQueueClient(object):
|
||||
connection = None
|
||||
channel = None
|
||||
queues = set()
|
||||
_inited = False
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
self.connection = None
|
||||
self.channel = None
|
||||
self.queues = set()
|
||||
self._inited = False
|
||||
|
||||
def initialize(self):
|
||||
# Initialize the connection
|
||||
|
||||
Reference in New Issue
Block a user