From b4bce19f34f3c84f94508d2e462862e9a27f4f6c Mon Sep 17 00:00:00 2001 From: Darrel Pol Date: Thu, 12 Sep 2024 21:39:38 -0500 Subject: [PATCH] adding process killer --- .github/workflows/on_merge_to_master.yaml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/on_merge_to_master.yaml b/.github/workflows/on_merge_to_master.yaml index a1e5632c9..1a83a803f 100644 --- a/.github/workflows/on_merge_to_master.yaml +++ b/.github/workflows/on_merge_to_master.yaml @@ -24,6 +24,16 @@ jobs: ssh -o ServerAliveInterval=60 -o ServerAliveCountMax=60 -o StrictHostKeyChecking=no ${{ secrets.MOONLITE_AWS_EC2_SSH_USER }}@${{ secrets.MOONLITE_AWS_EC2_SSH_HOST }} << 'EOF' cd /home/ec2-user/apps + # Kill any existing process of launch.py if running + echo "Checking for existing launch.py process..." + PID=\$(pgrep -f launch.py) + if [ -n "\$PID" ]; then + echo "Found running process for launch.py. Terminating PID \$PID..." + kill -9 \$PID + else + echo "No running process found for launch.py." + fi + # Check if the stable-diffusion-webui folder exists if [ ! -d "stable-diffusion-webui" ]; then echo "Cloning stable-diffusion-webui from GitHub..."