Page 1 of 1

Task is currently running or busy... "hangs" RoboTask execution of my task

Posted: Wed Jan 11, 2023 12:52 am
by freethecode
Hello, I have tried to do the following (RoboTask Pro Trial latest version)

I have Task A which calls B. It calls B like a "function". B is is a "helper" task.

1. Created a Task B to use like a "function".. that is it takes an input global var called $line and then splits this line (a=b) into 2 variables, then processes them by assigning them to 2 global "output" variables.
2. This code works great when is is integrated into the host task A. I mean if you took all the steps and copied them out of this "function" task B into another task e.g. the host task A it would work fine.
3. the host task A runs on a file changed (3 seconds I think) monitor. I changed 2 different files (compiled to them and then robotask detected the changes) and launched the host robotask task A
4. normally this works fine when all steps reside only within Task A
5. but after extracting steps from A into B and calling B instead, I now get the error below and neither of the Task A task instances ever complete.. they are locked in some kind of waiting state

Error:
W: 2023-01-11 3:35:31 AM: Task "A" is currently running or busy...

So what can I do to resolve this and make this 100% reliable? (and fast.. if the task takes minutes to complete that is no good for me)

The steps (About 5 or so) were extracted so that I could replace them in 10+ tasks that I spent hours today creating. So this is the goal here, to be able to have that code in a separate "function" so that if I need to make changes, I only have to do it in one spot.

Re: Task is currently running or busy... "hangs" RoboTask execution of my task

Posted: Wed Jan 11, 2023 1:11 pm
by Oleg
If you use Start Task action just switch ON the option "Wait for finish".
In this case parent task will wait for finish of slave task. Otherwise the slave task will woks in in asynchronous mode.

Also read about option "Required start"

Re: Task is currently running or busy... "hangs" RoboTask execution of my task

Posted: Wed Jan 11, 2023 1:34 pm
by freethecode
yes it is switched on.

I have a workaround for this problem.

the problem is because the task is set for 3 seconds monitoring.

And my compile time of the file that is being monitored is about 4-5 seconds.

So when I start the compile of the second file, I guess robotask is still processing the first new compiled file ( by processing I mean it is just basically copying it to another location)

So my workaround is if I wait 10 seconds between compiles, there is no conflict/hanging.

however it is not an ideal solution. as I usually like to compile these 2 files back to back as they share many functions.

Re: Task is currently running or busy... "hangs" RoboTask execution of my task

Posted: Thu Jan 12, 2023 7:34 am
by freethecode
ok, I found the cause of the problem.. there was a show message step in the 'function task' that somehow when the task is called doesn't get displayed, but still caused the task to hang because i guess nobody is dismissing the dialog, so I unchecked that step in the function task