Skip to content

Commit

Permalink
Merge pull request #5 from ioxiocom/feature/py3.11-support
Browse files Browse the repository at this point in the history
Supporting Python 3.11
  • Loading branch information
lietu authored Oct 20, 2023
2 parents 51ddb13 + 0c0ceb5 commit 151479f
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 7 deletions.
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,21 @@ Options:
--service-wait-time FLOAT How long to wait for a service to be up an
running (sec) [default: 3.0]
```

## Development

Make sure you install [pre-commit](https://pre-commit.com/#install) and run:

```shell
pre-commit install
```

For testing you can use e.g.

```shell
poetry run multi-start \
--backend \
--backend-dir ../another-project/src \
--backend-cmd "poetry run invoke dev" \
--backend-port 8080
```
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "multi-start"
version = "1.0.0"
version = "1.0.1"
description = "Run multiple services inside a docker container"
license = "BSD-3-Clause"
readme = "README.md"
Expand Down
15 changes: 9 additions & 6 deletions src/starter.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,9 +196,12 @@ async def start(
if nginx:
procs.append(await start_service(nginx))

tasks = [p.wait() for p in procs]
tasks.append(self._stop.wait())
await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)

logger.info("Shutting down all processes")
await asyncio.gather(*[stop_process(proc) for proc in procs])
try:
tasks = [asyncio.create_task(p.wait()) for p in procs]
tasks.append(asyncio.create_task(self._stop.wait()))
await asyncio.wait(tasks, return_when=asyncio.FIRST_COMPLETED)
finally:
logger.info("Shutting down all processes")
await asyncio.gather(
*[asyncio.create_task(stop_process(proc)) for proc in procs]
)

0 comments on commit 151479f

Please sign in to comment.