Update Sync
This commit is contained in:
@@ -49,8 +49,14 @@ public class EventQueue : IDisposable
|
||||
return evt;
|
||||
}
|
||||
|
||||
public List<SyncEvent> GetPending(int max = 200) =>
|
||||
_queue.Find(Query.All(nameof(SyncEvent.SequenceNr))).Take(max).ToList();
|
||||
public List<SyncEvent> GetPending(int max = SyncProtocol.PushBatchSize,
|
||||
IReadOnlySet<Guid>? excludedEventIds = null)
|
||||
{
|
||||
var pending = _queue.Find(Query.All(nameof(SyncEvent.SequenceNr))).AsEnumerable();
|
||||
if (excludedEventIds is not null)
|
||||
pending = pending.Where(e => !excludedEventIds.Contains(e.EventId));
|
||||
return pending.Take(max).ToList();
|
||||
}
|
||||
public int PendingCount() => _queue.Count();
|
||||
public void Acknowledge(IEnumerable<Guid> ids) { foreach (var id in ids) _queue.Delete(id); }
|
||||
public long GetLastServerSeq() => _meta.FindById("serverSeq")?.Value ?? 0;
|
||||
|
||||
Reference in New Issue
Block a user