// Token: 0x06001400 RID: 5120 RVA: 0x00073D14 File Offset: 0x00071F14
        protected override void DrainNotifications(ConcurrentDictionary <Guid, PushNotificationContext> notificationContexts)
        {
            MailboxNotificationBatch mailboxNotificationBatch = new MailboxNotificationBatch();

            foreach (Guid guid in notificationContexts.Keys)
            {
                if (base.CheckCancellation())
                {
                    return;
                }
                PushNotificationContext pushNotificationContext = notificationContexts[guid];
                MailboxNotification     notification            = this.CreateMailboxNotification(guid, pushNotificationContext);
                mailboxNotificationBatch.Add(notification);
                NotificationTracker.ReportCreated(notification, pushNotificationContext.OriginalTime);
                PushNotificationHelper.LogNotificationBatchEntry(guid, notification);
            }
            if (!mailboxNotificationBatch.IsEmpty)
            {
                ExTraceGlobals.PushNotificationAssistantTracer.TraceDebug <int>((long)this.GetHashCode(), "PushNotificationBatchManager.DrainNotifications: Ready to send notification batch, size:'{0}'.", mailboxNotificationBatch.Count);
                if (base.CheckCancellation())
                {
                    return;
                }
                PushNotificationBatchManager.notificationsPerBatchCounter.AddSample((long)mailboxNotificationBatch.Count);
                this.SendPublishNotificationRequest(mailboxNotificationBatch);
            }
            notificationContexts.Clear();
        }
Example #2
0
 // Token: 0x06001434 RID: 5172 RVA: 0x000749A4 File Offset: 0x00072BA4
 internal static void LogSendPublishNotificationException(Exception exception, MailboxNotificationBatch batch = null)
 {
     PushNotificationsMonitoring.PublishFailureNotification("SendPublishNotification", "", "");
     ExTraceGlobals.PushNotificationAssistantTracer.TraceError <string, string>(0L, "An error '{0}'-'{1}' was generated when publishing a notification batch.", exception.ToString(), (exception.InnerException != null) ? exception.InnerException.ToString() : string.Empty);
     PushNotificationsCrimsonEvents.SendPublishNotificationException.LogPeriodic <string>(exception.Message, CrimsonConstants.DefaultLogPeriodicSuppressionInMinutes, exception.ToTraceString());
     if (batch != null && batch.Notifications != null)
     {
         foreach (MailboxNotification notification in batch.Notifications)
         {
             NotificationTracker.ReportDropped(notification, exception.ToTraceString());
         }
     }
 }