summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/pgq/cascade/admin.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/python/pgq/cascade/admin.py b/python/pgq/cascade/admin.py
index e7ac8605..dd9215d8 100644
--- a/python/pgq/cascade/admin.py
+++ b/python/pgq/cascade/admin.py
@@ -422,12 +422,17 @@ class CascadeAdmin(skytools.AdminScript):
nodes = Queue.Queue()
# launch workers and wait
- n = max (min (members.qsize() >> 2, 100), 1)
- for i in range(n):
+ num_nodes = len(self.queue_info.member_map)
+ num_threads = max (min (num_nodes / 4, 100), 1)
+ tlist = []
+ for i in range(num_threads):
t = threading.Thread (target = self._cmd_status_worker, args = (members, nodes))
t.daemon = True
t.start()
- members.join()
+ tlist.append(t)
+ #members.join()
+ for t in tlist:
+ t.join()
while True:
try: