public void RunRoute(IRouteConfig routeConfig) { try { var route = _routeProvider.GetRoute(routeConfig); var completeMoment = (routeConfig.ForceAllContents ? DateTimeOffset.MinValue : _completeMomentProvider.GetCompleteMoment(route.Source.ID, route.Destination.ID)); DateTimeOffset sourceLastModifiedMoment; var contentIdentifiersList = GetReplicateContentIdentifiers(routeConfig, route, completeMoment, out sourceLastModifiedMoment).ToList(); if (contentIdentifiersList.Any()) { _routeReplicator.ReplicateRouteContents(route, contentIdentifiersList, routeConfig.ConnectionCountLimit); } else { var newCompleteMoment = new[] { completeMoment, sourceLastModifiedMoment }.Max(); _completeMomentProvider.SetCompleteMoment(route.Source.ID, route.Destination.ID, newCompleteMoment); } } finally { _completeMomentProvider.Finish(); } }
public void Finish() { _completeMomentProvider.Finish(); }