TMS Echo Replication Process

Hello,

we've two Echo Nodes, which shall replicate their Data every 5 Minutes.
Both Webserver and Localserver have following timer startet on creation:

  Timer := TSparkleTimer.Create(
    procedure(Echo: TObject)
    begin
      TEcho(Echo).BatchLoad;
      TEcho(Echo).Route;
    end,
    Echo, 5000, TTimerType.Periodic);

The Webserver wont push and pull data.
The Localserver on the other hand shall push/pull Data every 5 Minutes.
So i implemented a second timer which calls the following procedures:

procedure TServerContainer.Pull;
begin
  Echo.GetRemoteNode(URI_WEBSERVER).Pull;
  Echo.BatchLoad;
  Echo.Route;
end;
procedure TServerContainer.Push;
begin
  Echo.Route;
  Echo.GetRemoteNode(URI_WEBSERVER).Push;
end;

Every few hours the local Server Crashes and i have to restart the application.
I guess it's because these functions are asynchronous and therefore not finished when the timer triggers the replication process.
Could that be the problem?
Then i wonder if it's necessary to call Route and Batchload in the Pull procedure?

Kind regards,

Yes.
If you are already calling BatchLoad and Route in the timer, why are you calling it again in the Pull/Push methods?

In any case, you should guarantee that such Echo methods are not executed simultaneously. Make sure that a Route, Pull, Push or BatchLoad are not not called if any of other are not being executed.

Ok
Are there functions to check if an process has already finished?

No, you should do that control yourself.

But how can i control if BatchLoad has finished when there is no function for that?
Or is it save to make two functions like this

procedure TServerContainer.Batch;
begin
  Echo.BatchLoad;
  Echo.Route;
end;
procedure TServerContainer.FullReplication;
begin
  Echo.GetRemoteNode(URI_WEBSERVER).Pull;
  Echo.GetRemoteNode(URI_WEBSERVER).Push;  
  Echo.BatchLoad;
  Echo.Route;
end;

and either call the one or the other? Or is it problematic to put push and pull in one procedure?
Because if there is no way to check if the pull command has finished, i don't know how to control when the push command should be called and so on.

The commands are not asynchronous. So after the line is executed, the command is finished:

Echo.BatchLoad;
// BatchLoad has finished here.