Ejemplo n.º 1
0
        public async Task <GroupOperation[]> GetGroups(IAsyncDocumentSession session, string classifier, string classifierFilter)
        {
            var dbGroups = await GetDBGroups(session, classifier, classifierFilter).ConfigureAwait(false);

            var retryHistory = await session.LoadAsync <RetryHistory>(RetryHistory.MakeId()).ConfigureAwait(false) ?? RetryHistory.CreateNew();

            var unacknowledgedRetries = retryHistory.GetUnacknowledgedByClassifier(classifier);

            var openRetryAcknowledgements   = MapAcksToOpenGroups(dbGroups, unacknowledgedRetries);
            var closedRetryAcknowledgements = unacknowledgedRetries.Except(openRetryAcknowledgements).ToArray();

            var closedGroups = MapClosedGroups(classifier, closedRetryAcknowledgements);

            closedGroups = closedGroups.Union(MapClosedGroups(classifier, archivingManager.GetArchivalOperations().Where(archiveOp => archiveOp.NeedsAcknowledgement())));

            var openGroups = MapOpenGroups(dbGroups, retryHistory, openRetryAcknowledgements).ToList();

            openGroups = MapOpenGroups(openGroups, archivingManager.GetArchivalOperations()).ToList();
            openGroups = openGroups.Where(group => !closedGroups.Any(closedGroup => closedGroup.Id == group.Id)).ToList();

            MakeSureForwardingBatchIsIncludedAsOpen(classifier, await GetCurrentForwardingBatch(session).ConfigureAwait(false), openGroups);

            var groups = openGroups.Union(closedGroups);

            return(groups.OrderByDescending(g => g.Last).ToArray());
        }
Ejemplo n.º 2
0
        async Task <dynamic> GetRetryHistory()
        {
            using (var session = Store.OpenAsyncSession())
            {
                var retryHistory = await session.LoadAsync <RetryHistory>(RetryHistory.MakeId()).ConfigureAwait(false) ?? RetryHistory.CreateNew();

                return(Negotiate
                       .WithDeterministicEtag(retryHistory.GetHistoryOperationsUniqueIdentifier())
                       .WithModel(retryHistory));
            }
        }
Ejemplo n.º 3
0
        dynamic GetRetryHistory()
        {
            using (var session = Store.OpenSession())
            {
                var retryHistory = session.Load <RetryHistory>(RetryHistory.MakeId()) ?? RetryHistory.CreateNew();

                return(Negotiate
                       .WithDeterministicEtag(retryHistory.GetHistoryOperationsUniqueIdentifier())
                       .WithModel(retryHistory));
            }
        }