public async Task Handle(TimingCommand alertCommand, CancellationToken cancellationToken) { await _notifier.NotifyAsync(alertCommand.Message, alertCommand.IsAlarm); _alertCommandRepository.RemoveCommand(alertCommand.Id); alertCommand.AfterRun(); if (!alertCommand.IsComplete) { _alertCommandRepository.AddCommand(alertCommand); } _logger.LogInformation($"ID:{alertCommand.Id} is handled and its complete status is {alertCommand.IsComplete}"); }
public Task Handle(TimingCreatedNotification notification, CancellationToken cancellationToken) { _alertCommandRepository.AddCommand(notification.AlertCommand); _messenger.SendMessage(notification.Id, "Your Commanded Has Been Handled"); return(Task.CompletedTask); }