From be90aa095a62c1996c180d43b795f8f0dff3cd4c Mon Sep 17 00:00:00 2001 From: Luc Didry Date: Mon, 6 Jan 2025 14:36:42 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E2=80=94=20Fix=20strange=20and?= =?UTF-8?q?=20buggy=20behavior?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- argos/agent.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/argos/agent.py b/argos/agent.py index 2cca0d6..195ffdc 100644 --- a/argos/agent.py +++ b/argos/agent.py @@ -164,6 +164,7 @@ class ArgosAgent: # pylint: disable-msg=too-many-instance-attributes logger.info("Received %i tasks from the server", len(data)) req_groups = {} + _tasks = [] for _task in data: task = Task(**_task) @@ -187,6 +188,7 @@ class ArgosAgent: # pylint: disable-msg=too-many-instance-attributes "method": task.method, "request_data": task.request_data, } + _tasks.append(_task) requests = [] for group, details in req_groups.items(): @@ -196,7 +198,7 @@ class ArgosAgent: # pylint: disable-msg=too-many-instance-attributes await asyncio.gather(*requests) tasks = [] - for task in data: + for task in _tasks: tasks.append(self._complete_task(task)) if tasks: