Force Stop Script

Post Reply
ezninnovation
Newbie
Posts: 7
Joined: Tue May 14, 2024 8:46 pm

Force Stop Script

Post by ezninnovation »

When testing a script inside a flow, is there a way to force stop the script/flow? I have tried to stop the flow, but the element with the script is still stuck in the processing state so the flow won't stop. It will eventually timeout but it takes 15 minutes or so.

The message says "Some jobs are being process in the flow and the flow will be stopped as soon as they complete.
mkayyyy
Member
Posts: 98
Joined: Mon Nov 21, 2016 6:31 pm
Location: UK

Re: Force Stop Script

Post by mkayyyy »

I'd open the Progress pane in the Switch Designer, find the script that is stuck executing in the Progress pane, copy the Process ID and kill it in Resource Monitor (If you're on Windows, unsure on the Mac alternative) which will then let the flow stop

Image
User avatar
tdeschampsBluewest
Member
Posts: 127
Joined: Tue Jun 01, 2021 11:57 am

Re: Force Stop Script

Post by tdeschampsBluewest »

If you are lazy to search the ID in the ressource monitor, create a .bat with this ::

Code: Select all

@echo off
:Ask
echo processus to kill ? (number)
set INPUT=
set /p INPUT=%=%

TASKKILL /f /im %INPUT%
goto :Ask
Run it in administrator mode, then type the PID to kill it.
Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
User avatar
JimmyHartington
Advanced member
Posts: 453
Joined: Tue Mar 22, 2011 7:38 am

Re: Force Stop Script

Post by JimmyHartington »

Nice .bat file.
I will use this on my server.
User avatar
tdeschampsBluewest
Member
Posts: 127
Joined: Tue Jun 01, 2021 11:57 am

Re: Force Stop Script

Post by tdeschampsBluewest »

Since we are on batFile, you can also use the following one.

:!: :!: :!: Keep in mind this one can be pretty nasty :evil: , and should be use in last resort at your own risk

Code: Select all

@echo off
:Ask
echo Are you sure to kill Switch?(y/n)
set INPUT=
set /P INPUT=Type input: %=%

If /I "%INPUT%"=="y" goto TaskKill
If /I "%INPUT%"=="n" goto Exit

:TaskKill
TASKKILL /f /im SwitchWatchdog.exe
TASKKILL /f /im Switch.exe
TASKKILL /f /im Switch_Service.exe
TASKKILL /f /im Switch_Helper.exe
TASKKILL /f /im SwitchScriptExecutor.exe
TASKKILL /f /im EnfocusSubscriptionNotifier.exe
timeout 2 >nul
goto Ask
:Exit
timeout 1 >nul
exitw

Do you like the Enfocus Apps developed by Bluewest?
Feel free to leave a comment on the Appstore!
jan_suhr
Advanced member
Posts: 687
Joined: Fri Nov 04, 2011 1:12 pm
Location: Nyköping, Sweden

Re: Force Stop Script

Post by jan_suhr »

Have you tried the Switch preferences/Error handling/Abort processes after (minutes) and set it to just 1 minute. Then it should quit gracefully and just stop the problem flow.

You can change this while testing and then put it back to normal when you're done?
Jan Suhr
Color Consult AB
Sweden
=============
Check out my apps
Post Reply