Skip to content

Commit

Permalink
Merge branch 'issue-335' into main-master
Browse files Browse the repository at this point in the history
  • Loading branch information
damianh committed Apr 1, 2014
2 parents 3a79547 + 12a1abd commit 828bb20
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions src/NEventStore/OptimisticEventStore.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ namespace NEventStore
{
using System;
using System.Collections.Generic;
using System.Linq;
using NEventStore.Logging;
using NEventStore.Persistence;

Expand All @@ -25,26 +24,9 @@ public OptimisticEventStore(IPersistStreams persistence, IEnumerable<IPipelineHo
_persistence = new PipelineHooksAwarePersistanceDecorator(persistence, _pipelineHooks);
}

public virtual IEnumerable<ICommit> GetFrom(string bucketId, string streamId, int minRevision, int maxRevision)
{
foreach (var commit in _persistence.GetFrom(bucketId, streamId, minRevision, maxRevision))
{
ICommit filtered = commit;
foreach (var hook in _pipelineHooks.Where(x => (filtered = x.Select(filtered)) == null))
{
Logger.Info(Resources.PipelineHookSkippedCommit, hook.GetType(), commit.CommitId);
break;
}

if (filtered == null)
{
Logger.Info(Resources.PipelineHookFilteredCommit);
}
else
{
yield return filtered;
}
}
public virtual IEnumerable<ICommit> GetFrom(string bucketId, string streamId, int minRevision, int maxRevision)
{
return _persistence.GetFrom(bucketId, streamId, minRevision, maxRevision);
}

public virtual ICommit Commit(CommitAttempt attempt)
Expand Down

0 comments on commit 828bb20

Please sign in to comment.