Browse Source

Store routing_keys in a dict instead of set

This will let us keep track of which react script uses what routing
key. We will lose the set property, but that is immaterial because
the system will be in trouble anyway, if there are duplicate keys

Change-Id: I89299fcb7dfbe7ab4d7b2d1df9c1cb001489fd5f
Pranesh Pandurangan 4 years ago
parent
commit
0173ef0b53
1 changed files with 2 additions and 2 deletions
  1. 2
    2
      entropy/engine.py

+ 2
- 2
entropy/engine.py View File

@@ -73,7 +73,7 @@ class Engine(object):
73 73
                                    self.engine_cfg: self.engine_disabled}
74 74
         # Private variables to keep track of repair scripts.
75 75
         self._repairs = []
76
-        self._known_routing_keys = set()
76
+        self._known_routing_keys = collections.defaultdict(list)
77 77
 
78 78
         # Watchdog-related variables
79 79
         self._watchdog_thread = None
@@ -314,7 +314,7 @@ class Engine(object):
314 314
                                   data['routing_key'])
315 315
             if message_queue not in self.known_queues:
316 316
                 self.known_queues.append(message_queue)
317
-            self._known_routing_keys.add(data['routing_key'])
317
+            self._known_routing_keys[script].append(data['routing_key'])
318 318
             kwargs = data
319 319
             kwargs['name'] = script
320 320
             kwargs['conf'] = script_args['cfg']

Loading…
Cancel
Save