Beispiel #1
0
        // Token: 0x060019CC RID: 6604 RVA: 0x0006BFC4 File Offset: 0x0006A1C4
        private void UpdateProgress(string seedingHandle, IReplicaSeederCallback callback)
        {
            ReplayStopwatch       replayStopwatch       = new ReplayStopwatch();
            ProgressCiFileRequest progressCiFileRequest = new ProgressCiFileRequest(this.channel, this.databaseGuid, seedingHandle);
            int      num     = -1;
            TimeSpan timeout = TimeSpan.FromSeconds((double)RegistryParameters.SeedCatalogProgressIntervalInSec);
            int      progress;

            for (;;)
            {
                progressCiFileRequest.Send();
                replayStopwatch.Restart();
                NetworkChannelMessage message             = this.channel.GetMessage();
                ProgressCiFileReply   progressCiFileReply = message as ProgressCiFileReply;
                if (progressCiFileReply == null)
                {
                    this.channel.ThrowUnexpectedMessage(message);
                }
                ExTraceGlobals.SeederServerTracer.TraceDebug <long>((long)this.GetHashCode(), "ProgressCiFile response took: {0}ms", replayStopwatch.ElapsedMilliseconds);
                progress = progressCiFileReply.Progress;
                ExTraceGlobals.SeederServerTracer.TraceDebug <int>((long)this.GetHashCode(), "Get seeding progress: {0}", progress);
                if (callback != null && callback.IsBackupCancelled())
                {
                    break;
                }
                if (progress < 0)
                {
                    goto Block_4;
                }
                if (progress > num)
                {
                    ExTraceGlobals.SeederServerTracer.TraceDebug <Guid, int, bool>((long)this.GetHashCode(), "Updating progress for catalog '{0}'. Percent = {1}%. Callback = {2}", this.databaseGuid, progress, callback != null);
                    if (callback != null)
                    {
                        callback.ReportProgress("IndexSystem", 102400L, (long)progress * 1024L, (long)progress * 1024L);
                    }
                    num = progress;
                }
                if (progress == 100)
                {
                    return;
                }
                Thread.Sleep(timeout);
            }
            ExTraceGlobals.SeederServerTracer.TraceDebug <int>((long)this.GetHashCode(), "The seeding was cancelled at {0}%", num);
            throw new SeederOperationAbortedException();
Block_4:
            Exception innerException = new CiSeederGenericException(this.sourceServerFqdn, this.targetServerFqdn, ReplayStrings.CiSeederExchangeSearchTransientException(string.Format("{0}", progress)));

            throw new PerformingFastOperationException(innerException);
        }