Пример #1
0
 public async Task <IEnumerable <CapPublishedMessage> > GetPublishedMessagesOfNeedRetry()
 {
     return(await PublishedMessages.ToAsyncEnumerable()
            .Where(x => x.Retries < _capOptions.FailedRetryCount &&
                   x.Added < DateTime.Now.AddSeconds(-10) &&
                   (x.StatusName == StatusName.Scheduled || x.StatusName == StatusName.Failed))
            .Take(200)
            .ToListAsync());
 }
Пример #2
0
 public Task <CapPublishedMessage> GetPublishedMessageAsync(long id)
 {
     return(PublishedMessages.ToAsyncEnumerable().FirstOrDefaultAsync(x => x.Id == id));
 }