Add an arg for shutdown timeout in deploy down command

This commit is contained in:
Prathamesh Musale 2023-04-25 11:45:59 +05:30
parent 988be0ef9a
commit 29094f173c
4 changed files with 10 additions and 4 deletions

View File

@ -70,7 +70,7 @@ docker logs -f <CONTAINER_ID>
Stop all services running in the background: Stop all services running in the background:
```bash ```bash
laconic-so --stack fixturenet-optimism deploy down laconic-so --stack fixturenet-optimism deploy down 30
``` ```
Clear volumes created by this stack: Clear volumes created by this stack:

View File

@ -90,7 +90,7 @@ docker logs -f <CONTAINER_ID>
Stop all services running in the background: Stop all services running in the background:
```bash ```bash
laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down laconic-so --stack fixturenet-optimism deploy --include fixturenet-optimism down 30
``` ```
Clear volumes created by this stack: Clear volumes created by this stack:

View File

@ -111,7 +111,7 @@ Follow the [demo](./demo.md) to try out the MobyMask app with L2 chain
Stop all the services running in background run: Stop all the services running in background run:
```bash ```bash
laconic-so --stack mobymask-v2 deploy-system down laconic-so --stack mobymask-v2 deploy-system down 30
``` ```
Clear volumes created by this stack: Clear volumes created by this stack:

View File

@ -74,7 +74,13 @@ def command(ctx, include, exclude, env_file, cluster, command, extra_args):
elif command == "down": elif command == "down":
if verbose: if verbose:
print("Running compose down") print("Running compose down")
docker.compose.down()
timeout_arg = None
if extra_args_list:
timeout_arg=extra_args_list[0]
# Specify shutdown timeout (default 10s) to give services enough time to shutdown gracefully
docker.compose.down(timeout=timeout_arg)
elif command == "exec": elif command == "exec":
if extra_args_list is None or len(extra_args_list) < 2: if extra_args_list is None or len(extra_args_list) < 2:
print("Usage: exec <service> <cmd>") print("Usage: exec <service> <cmd>")