From d1ea69262a3553576b3151c066605ff4a8daa4d8 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sun, 15 Dec 2019 19:50:47 +0100 Subject: [PATCH] Prevent active wait on the list of workers --- platypush/utils/workers.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/platypush/utils/workers.py b/platypush/utils/workers.py index 37cd63581a..6b41626ed3 100644 --- a/platypush/utils/workers.py +++ b/platypush/utils/workers.py @@ -111,14 +111,12 @@ class Workers: :ret: A list containing the processed responses """ while self._workers: - for i, wrk in enumerate(self._workers): - if not self._workers[i].is_alive(): - self._workers.pop(i) - break + wrk = self._workers.pop() + wrk.join() - self.responses = [] while not self.response_queue.empty(): self.responses.append(self.response_queue.get()) + return self.responses def end_stream(self):