public async Task HandleAsync(List <MobilePushJob> jobs, bool isLastAttempt, CancellationToken ct)
 {
     foreach (var job in jobs)
     {
         if (await userNotificationStore.IsConfirmedOrHandled(job.Notification.Id, Name))
         {
             await UpdateAsync(job.Notification, ProcessStatus.Skipped);
         }
         else
         {
             await SendAsync(job, isLastAttempt, ct);
         }
     }
 }
Beispiel #2
0
        public async Task HandleAsync(List <EmailJob> jobs, bool isLastAttempt, CancellationToken ct)
        {
            var notifications = new List <UserNotification>();

            foreach (var job in jobs)
            {
                if (await userNotificationStore.IsConfirmedOrHandled(job.Notification.Id, Name))
                {
                    await UpdateAsync(notifications, ProcessStatus.Skipped);
                }
                else
                {
                    notifications.Add(job.Notification);
                }
            }

            if (notifications.Any())
            {
                await SendAsync(notifications, isLastAttempt, ct);
            }
        }