I have studied issues with the Kill button in the past. I understand that the murder signal is actually sent immediately to the mission. However, if the task is occupied by some other API (or something in this direction), this does not guarantee that it will be raised. However, the destruction signal will not be saved, or the work will immediately respond to it, or it will be ignored. This may be the case here when you sleep for a minute.
So, as work, I would create my own mechanism to tell your script that it should stop. This can be done by placing the file in a specific location (for example, in the groovy script job space). This can be done using the second job Kill_job_1. Now, before your work starts to sleep (or immediately after it wakes up), you check for the presence of this file and end your script if the file is found. Remember to make sure the file is cleaned when you start your work a second time.
source share