Exemplo n.º 1
0
        public DateTimeOffset GetCompleteMoment(string sourceID, string destinationID)
        {
            _logger.LogTrace($"Start getting complete moment for source {sourceID} and destination {destinationID}");

            var result = _completeMomentProvider.GetCompleteMoment(sourceID, destinationID);

            _logger.LogTrace($"End getting complete moment for source {sourceID} and destination {destinationID}");

            return(result);
        }
Exemplo n.º 2
0
        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();
            }
        }