Monitor whether a script is running but frozen for a while
I am running sikulix to automate the photo-labeling cross the sample surface on a microscope. The surface is split into many tiles which the sikulix will manipulate to loop through. The whole process is time-consuming and man-unattended.
I have script_a and script_b. script_b does the trivial jobs at every tile and loop through the tiles.
script_a will call script_b and send me a warning message when script_b crashes:
i.e.
exitValue = runScript(script_b)
if exitValue == 1:
"send me the warning message"
Everytime, I directly run script_a.
However,
there is an occasion that script_b does NOT crash but freeze for a long time without being noticed.
I don't know which step in script_b will be strangled.
What I propose to do is firstly to log a time when script_b initiates in a txt file, then a code can keep monitoring the system time. If the time passed by is longer than a certain time (saying 30 min), a warning message will be triggered and sent to me.
I don't know how to make it work properly as it sounds like I need two sikulix scripts run simultaneouly.
There could be a better solution than my proposal.
I use window 7, sikulix IDE 1.1.4 currently.
Please guide me to deal with this problem. Thanks a lot!
Question information
- Language:
- English Edit question
- Status:
- Answered
- For:
- SikuliX Edit question
- Assignee:
- No assignee Edit question
- Last query:
- Last reply:
Can you help with this problem?
Provide an answer of your own, or ask BOCHENG YIN for more information if necessary.