示例#1
0
        public async Task ProcessAsync()
        {
            _logger.LogTrace("Starting fallback EventProcessor");

            var messages = (await _eventStore.GetUnpublishedAsync(TimeSpan.FromDays(FallbackDays))).ToArray();

            if (messages.Length == 0)
            {
                return;
            }

            _logger.LogInformation("Processing {EventCount} events in fallback EventProcessor", messages.Length);

            try
            {
                foreach (var message in messages)
                {
                    await _eventProcessor.ProcessAsync(message.Id);
                }
            }
            catch (Exception e)
            {
                _logger.LogError(e, "Error processing events in fallback EventProcessor");
            }
        }