Skip to content

Commit

Permalink
Make processing script Python 3.12 compatible
Browse files Browse the repository at this point in the history
  • Loading branch information
gregorjerse committed Nov 25, 2024
1 parent e20bbb0 commit 82abcf7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
9 changes: 9 additions & 0 deletions docs/CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@ All notable changes to this project are documented in this file.
This project adheres to `Semantic Versioning <http://semver.org/>`_.


==========
Unreleased
==========

Changed
-------
- Make processing container startup script ``Python`` 3.12 compatible


===================
42.0.1 - 2024-11-21
===================
Expand Down
9 changes: 6 additions & 3 deletions resolwe/flow/executors/startup_processing_container.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,10 @@ async def run(self) -> int:
"""
try:
await asyncio.wait(
[self.protocol_handler.script_started.wait(), self._terminating.wait()],
[
asyncio.create_task(self.protocol_handler.script_started.wait()),
asyncio.create_task(self._terminating.wait()),
],
timeout=SCRIPT_START_TIMEOUT,
return_when=asyncio.FIRST_COMPLETED,
)
Expand All @@ -499,10 +502,10 @@ async def run(self) -> int:
)
else:
monitored_tasks = (
self.script_server.wait_closed(),
asyncio.create_task(self.script_server.wait_closed()),
self.upload_handler.upload_task,
self.communicator_task,
self._terminating.wait(),
asyncio.create_task(self._terminating.wait()),
)
# Stop processing when any of the following tasks complete.
await asyncio.wait(monitored_tasks, return_when=asyncio.FIRST_COMPLETED)
Expand Down

0 comments on commit 82abcf7

Please sign in to comment.