From 999341c7ed56f1de65d4e044616ceb0e80c2ef63 Mon Sep 17 00:00:00 2001 From: Erik Taubeneck Date: Wed, 15 May 2024 12:52:10 -0700 Subject: [PATCH] bugfixes for local dev setup (#23) --- sidecar/app/command.py | 9 +++++---- sidecar/cli/cli.py | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/sidecar/app/command.py b/sidecar/app/command.py index f21508d..cd8ef5c 100644 --- a/sidecar/app/command.py +++ b/sidecar/app/command.py @@ -82,10 +82,11 @@ def __enter__(self): def signal_handler(self, sig, _frame): print(f"Handling signal: {sig}") for process in self.processes: - for child in psutil.Process(process.pid).children(recursive=True): - child.terminate() - print(f"Terminating: {child}") - process.terminate() + if psutil.pid_exists(process.pid): + for child in psutil.Process(process.pid).children(recursive=True): + child.terminate() + print(f"Terminating: {child}") + process.terminate() print(f"Terminating: {process}") sys.exit(0) diff --git a/sidecar/cli/cli.py b/sidecar/cli/cli.py index b5fc98e..de910cb 100644 --- a/sidecar/cli/cli.py +++ b/sidecar/cli/cli.py @@ -265,7 +265,7 @@ def run_local_dev( identity=role, helper_port=helper_ports[role], sidecar_port=sidecar_ports[role], - root_path=root_path, + root_path=root_path / Path(f"tmp/sidecar/{role.value}"), _env=_env, ) for role in Role