mirror of
https://github.com/containers/podman-compose.git
synced 2025-08-15 08:12:37 +02:00
add TQDM and implement pool.join
This commit is contained in:
@ -2580,7 +2580,7 @@ async def compose_exec(compose, args):
|
|||||||
sys.exit(p)
|
sys.exit(p)
|
||||||
|
|
||||||
|
|
||||||
async def transfer_service_status(compose, args, action):
|
async def transfer_service_status(compose: PodmanCompose, args, action):
|
||||||
# TODO: handle dependencies, handle creations
|
# TODO: handle dependencies, handle creations
|
||||||
container_names_by_service = compose.container_names_by_service
|
container_names_by_service = compose.container_names_by_service
|
||||||
if not args.services:
|
if not args.services:
|
||||||
@ -2595,8 +2595,7 @@ async def transfer_service_status(compose, args, action):
|
|||||||
targets = list(reversed(targets))
|
targets = list(reversed(targets))
|
||||||
podman_args = []
|
podman_args = []
|
||||||
timeout_global = getattr(args, "timeout", None)
|
timeout_global = getattr(args, "timeout", None)
|
||||||
tasks = []
|
for target in tqdm(targets):
|
||||||
for target in targets:
|
|
||||||
if action != "start":
|
if action != "start":
|
||||||
timeout = timeout_global
|
timeout = timeout_global
|
||||||
if timeout is None:
|
if timeout is None:
|
||||||
@ -2607,8 +2606,8 @@ async def transfer_service_status(compose, args, action):
|
|||||||
timeout = str_to_seconds(timeout_str)
|
timeout = str_to_seconds(timeout_str)
|
||||||
if timeout is not None:
|
if timeout is not None:
|
||||||
podman_args.extend(["-t", str(timeout)])
|
podman_args.extend(["-t", str(timeout)])
|
||||||
tasks.append(asyncio.create_task(compose.podman.run([], action, podman_args + [target])))
|
compose.pool.run([], action, podman_args + [target], name=target)
|
||||||
await asyncio.gather(*tasks)
|
await compose.pool.join()
|
||||||
|
|
||||||
|
|
||||||
@cmd_run(podman_compose, "start", "start specific services")
|
@cmd_run(podman_compose, "start", "start specific services")
|
||||||
|
Reference in New Issue
Block a user