Page 1 of 1

Send Command with return

Posted: Tue Apr 28, 2020 4:39 pm
by manxasp
Hi,

I have two servers, Server 1 r File Server and Server 2 r File Processor.

When i get new files in server 1:
File Loop
copy file to folder on Server 2
Send Command to Task on Server 2 to process File
if receive Started 1 tasks
log message = "ok"
end if
end loop

but if i receive 4 files, the loop will send 4 commands to start the same task on Server 2, but the Server will still be executing the first command.

Its possible add "Wait For Finish" in send command or return "Started 0 tasks" when the task is not started because it is already running?

Re: Send Command with return

Posted: Tue Apr 28, 2020 7:06 pm
by Oleg
Unfortunately Send command action works in asynchronous mode
What happened:
  • the action sends the command
  • Listener trigger accepts it, starts the task and send the response immediately about started tasks
  • the task can work some time but the sender already received the answer
Check RoboTask.Log (or system log) on Server2. I think that it accepted all 4 commands but it get warning "Task <taskname> is currently running... "
The Listener trigger run the task only but it don't know how much time work the task. To inform server1 about finish you can put Send Command at the end of the task (send some string to server1)

I think that you have to modify you automation
The algorithm will be such
  1. copy all files to server2
  2. send the command with the list of files
Thus the task will receive the list of files to process


Another way
You can simply insert a sufficient pause into the loop to process the file.
For example, a file is processed within 5 seconds. Put the pause for 8-10 seconds.