Send Command with return

Discuss RoboTask here
Post Reply
manxasp
Posts: 4
Joined: Sat Dec 29, 2018 5:03 pm

Send Command with return

Post 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?
Oleg
Site Admin
Posts: 3000
Joined: Thu Jan 01, 1970 1:00 am
Contact:

Re: Send Command with return

Post 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.
Oleg Yershov
Post Reply