示例#1
0
        /// <summary> Tries to dequeue a report from the list. </summary>
        public bool TryDequeueReport(out FGenericCrashContext Context)
        {
            lock (NewReportsLock)
            {
                if (NewCrashContexts.Count > 0)
                {
                    Context = NewCrashContexts.Dequeue();
                    DequeueCounter.AddEvent();
                    CrashReporterProcessServicer.StatusReporter.IncrementCount(QueueProcessingStartedEventName);
                    CrashReporterProcessServicer.WriteEvent(string.Format("- Dequeued: {0:N1}/minute BuiltFromCL={1,7} Path={2}", DequeueCounter.EventsPerSecond * 60, Context.PrimaryCrashProperties.EngineVersion, Context.CrashDirectory));
                    return(true);
                }
            }

            Context = null;
            return(false);
        }
示例#2
0
        public virtual void Dispose()
        {
            // Attempt to remove the queued crashes from the ReportIndex
            lock (NewReportsLock)
            {
                CrashReporterProcessServicer.WriteEvent(string.Format("{0} shutting down", QueueName));
                CrashReporterProcessServicer.WriteEvent(string.Format("{0} dequeuing {1} crashes for next time", QueueName, NewCrashContexts.Count));

                while (NewCrashContexts.Count > 0)
                {
                    try
                    {
                        string ReportName = Path.GetFileName(NewCrashContexts.Peek().CrashDirectory);
                        CrashReporterProcessServicer.ReportIndex.TryRemoveReport(ReportName);
                    }
                    finally
                    {
                        NewCrashContexts.Dequeue();
                    }
                }
            }
        }