public async Task ProcessGroupAsync(long uid, long[] urns, DateTime pointInTime, CancellationToken cancellationToken) { // Check if group changed var previous = await _groupRepository.GetGroupAsync(uid, pointInTime, cancellationToken); var staging = await _groupRepository.GetGroupFromStagingAsync(uid, pointInTime, cancellationToken); var groupChanged = false; if (previous == null) { _logger.Info($"Group {uid} has not been seen before {pointInTime}. Processing as created"); await StoreGroupAndRaiseEventAsync(staging, false, cancellationToken); groupChanged = true; } else if (!AreSame(previous, staging)) { _logger.Info($"Group {uid} on {pointInTime} has changed since {previous.PointInTime}. Processing as updated"); await StoreGroupAndRaiseEventAsync(staging, true, cancellationToken); groupChanged = true; } else { _logger.Info($"Group {uid} on {pointInTime} has not changed since {previous.PointInTime}. Skipping"); } // Check establishments for change await ProcessEstablishmentsAsync(urns, pointInTime, groupChanged, cancellationToken); }
public void SendEmail(string message) { _logger.Info(message); }