예제 #1
0
 private async Task UpdateAsync(WebPushJob job, ProcessStatus status, string?reason = null)
 {
     // We only track the initial publication.
     if (!job.IsUpdate)
     {
         await userNotificationStore.CollectAndUpdateAsync(job, Name, job.Subscription.Endpoint, status, reason);
     }
 }
예제 #2
0
 private async Task UpdateAsync(WebhookJob job, ProcessStatus status, string?reason = null)
 {
     // We only track the initial publication.
     if (!job.IsUpdate)
     {
         await userNotificationStore.CollectAndUpdateAsync(job.Notification, Name, job.WebhookId, status, reason);
     }
 }
예제 #3
0
        public async Task SendAsync(UserNotification notification, ChannelSetting settings, string configuration, SendOptions options,
                                    CancellationToken ct)
        {
            using (Telemetry.Activities.StartActivity("WebChannel/SendAsync"))
            {
                try
                {
                    await streamClient.SendAsync(notification);

                    await userNotificationStore.CollectAndUpdateAsync(notification, Name, configuration, ProcessStatus.Handled, ct : ct);
                }
                catch (Exception ex)
                {
                    await userNotificationStore.CollectAndUpdateAsync(notification, Name, configuration, ProcessStatus.Failed, ct : ct);

                    log.LogError(ex, "Failed to send web message.");
                }
            }
        }
예제 #4
0
 private Task UpdateAsync(UserNotification notification, ProcessStatus status, string?reason = null)
 {
     return(userNotificationStore.CollectAndUpdateAsync(notification, Name, status, reason));
 }