08.02.2019, 09:23
Is there a way to cancel running events scripts e.g.
button for day scene and night scene which sends 0 or 1.
Every execute of command first cancel all instances of this script and after run new instances which run code.
Every script executes ~20 commands and waits 0.5s(pause between commands) or until one zone ends the motion. Whole scene continues a few minutes.
So I think this is something different from not allowing to start new same script by semaphore lock. I can save process id and then kill all existing processes which would be stored in some place but then probably there would be some problems with race condition.
Maybe there is some more elegant way.
button for day scene and night scene which sends 0 or 1.
Every execute of command first cancel all instances of this script and after run new instances which run code.
Every script executes ~20 commands and waits 0.5s(pause between commands) or until one zone ends the motion. Whole scene continues a few minutes.
So I think this is something different from not allowing to start new same script by semaphore lock. I can save process id and then kill all existing processes which would be stored in some place but then probably there would be some problems with race condition.
Maybe there is some more elegant way.
Done is better than perfect