Пример #1
0
        private TimeSpan GetResourceMonitorDelay()
        {
            DelayInfo delay = ResourceLoadDelayInfo.GetDelay(this.budget, PublicFolderSynchronizer.WorkloadSettings, this.resourcesToAccess, true);

            if (delay != null)
            {
                PublicFolderSynchronizer.Tracer.TraceDebug <TimeSpan>((long)this.GetHashCode(), "Resource load provided delay info: {0}", delay.Delay);
                if (delay.Delay > this.maximumAllowedDelay)
                {
                    string text = string.Format("Delay suggested by ResourceMonitor of {0} ms has exceeded the maximum allowed delay of {1} ms", delay.Delay.TotalMilliseconds, this.maximumAllowedDelay.TotalMilliseconds);
                    if (this.syncContext.IsHierarchyReady)
                    {
                        throw new StorageTransientException(new LocalizedString(text));
                    }
                    PublicFolderSynchronizerLogger.LogOnServer(text, LogEventType.Warning, new Guid?(this.syncContext.CorrelationId));
                    return(this.maximumAllowedDelay);
                }
            }
            if (delay == null)
            {
                return(TimeSpan.Zero);
            }
            return(delay.Delay);
        }
 public DelayInfo GetDelay()
 {
     return(ResourceLoadDelayInfo.GetDelay(this.ibudget, TeamMailboxSyncResourceMonitorFactory.TeamMailboxSyncResourceMonitor.workloadSettings, this.resourcesToAccess, true));
 }