public static bool ResetError(string errorKey)
        {
            bool flag = false;

            IgnoreTransientErrors.CheckFailureInfo checkFailureInfo;
            if (IgnoreTransientErrors.Failures.TryGetValue(errorKey, out checkFailureInfo))
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)IgnoreTransientErrors.Failures.GetHashCode(), "ResetError(): Resetting error with key '{0}'.", errorKey);
                if (checkFailureInfo.ErrorType != ErrorType.Success)
                {
                    flag = true;
                }
                checkFailureInfo.NumSuccessiveFailures = 0U;
                checkFailureInfo.LatestPass            = DateTime.UtcNow;
                checkFailureInfo.ErrorType             = ErrorType.Success;
            }
            else
            {
                flag = true;
                ExTraceGlobals.HealthChecksTracer.TraceDebug <string, bool>((long)IgnoreTransientErrors.Failures.GetHashCode(), "ResetError(): First time recording error with key '{0}'. Returning isTransitioningState={1}.", errorKey, flag);
                ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)IgnoreTransientErrors.Failures.GetHashCode(), "ResetError(): Error with key '{0}' has not been logged before. This means it hasn't failed or issued a warning before.", errorKey);
                checkFailureInfo = new IgnoreTransientErrors.CheckFailureInfo(DateTime.UtcNow);
                IgnoreTransientErrors.Failures[errorKey] = checkFailureInfo;
            }
            return(flag);
        }
        public static bool IgnoreTransientError(string errorKey, uint transientErrorWindowMinutes, ErrorType errorType, out bool isTransitioningState)
        {
            bool flag = false;
            long num  = (long)((ulong)(transientErrorWindowMinutes * 60U));

            IgnoreTransientErrors.CheckFailureInfo checkFailureInfo;
            if (IgnoreTransientErrors.Failures.TryGetValue(errorKey, out checkFailureInfo))
            {
                checkFailureInfo.NumSuccessiveFailures += 1U;
                if (checkFailureInfo.LatestPass >= checkFailureInfo.StartOfFailures)
                {
                    checkFailureInfo.StartOfFailures = DateTime.UtcNow;
                }
                if (num == 0L)
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Error with key '{0}' is _NOT_ being ignored. It has now occurred {1} successive times, which exceeds the maximum {2} secs. Last pass time is: {3}. Start of Failures is: {4}. FailedDuration is: {5} secs. ", new object[]
                    {
                        errorKey,
                        checkFailureInfo.NumSuccessiveFailures,
                        num,
                        checkFailureInfo.LatestPass,
                        checkFailureInfo.StartOfFailures,
                        checkFailureInfo.FailedDurationSeconds
                    });
                }
                else if (checkFailureInfo.FailedDurationSeconds <= num)
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Error with key '{0}' is being ignored. It has now occurred {1} successive times. Last pass time is: {2}. Start of Failures is: {3}. FailedDuration is: {4} secs. Threshold is: {5} secs.", new object[]
                    {
                        errorKey,
                        checkFailureInfo.NumSuccessiveFailures,
                        checkFailureInfo.LatestPass,
                        checkFailureInfo.StartOfFailures,
                        checkFailureInfo.FailedDurationSeconds,
                        num
                    });
                    flag = true;
                }
                else
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Error with key '{0}' is _NOT_ being ignored. It has now occurred {1} successive times, which exceeds the maximum {2} secs. Last pass time is: {3}. Start of Failures is: {4}. FailedDuration is: {5} secs.", new object[]
                    {
                        errorKey,
                        checkFailureInfo.NumSuccessiveFailures,
                        num,
                        checkFailureInfo.LatestPass,
                        checkFailureInfo.StartOfFailures,
                        checkFailureInfo.FailedDurationSeconds
                    });
                }
                if (checkFailureInfo.ErrorType != errorType || checkFailureInfo.LastIgnoreTransientErrorValue != flag)
                {
                    isTransitioningState = true;
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Setting isTransitioningState={0} for errorKey '{1}'. LastIgnoreTransientErrorValue is: {2}. Current IgnoreTransientErrorValue is: {3}. Last ErrorType is: {4}. Current ErrorType is: {5}.", new object[]
                    {
                        isTransitioningState,
                        errorKey,
                        checkFailureInfo.LastIgnoreTransientErrorValue,
                        flag,
                        checkFailureInfo.ErrorType,
                        errorType
                    });
                }
                else
                {
                    isTransitioningState = false;
                }
                checkFailureInfo.ErrorType = errorType;
            }
            else
            {
                isTransitioningState = true;
                ExTraceGlobals.HealthChecksTracer.TraceDebug <string, bool>((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): First time recording error with key '{0}'. Returning isTransitioningState={1}.", errorKey, isTransitioningState);
                checkFailureInfo = new IgnoreTransientErrors.CheckFailureInfo(DateTime.UtcNow, errorType);
                IgnoreTransientErrors.Failures[errorKey] = checkFailureInfo;
                if (num == 0L)
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Error with key '{0}' is _NOT_ being ignored. It has now occurred {1} successive times, which exceeds the maximum {2} secs. Last pass time is: {3}. Start of Failures is: {4}. FailedDuration is: {5} secs. ", new object[]
                    {
                        errorKey,
                        checkFailureInfo.NumSuccessiveFailures,
                        num,
                        checkFailureInfo.LatestPass,
                        checkFailureInfo.StartOfFailures,
                        checkFailureInfo.FailedDurationSeconds
                    });
                }
                else if (checkFailureInfo.FailedDurationSeconds <= num)
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Error with key '{0}' is being ignored. It has now occurred {1} successive times. Last pass time is: {2}. Start of Failures is: {3}. FailedDuration is: {4} secs. Threshold is: {5} secs.", new object[]
                    {
                        errorKey,
                        checkFailureInfo.NumSuccessiveFailures,
                        checkFailureInfo.LatestPass,
                        checkFailureInfo.StartOfFailures,
                        checkFailureInfo.FailedDurationSeconds,
                        num
                    });
                    flag = true;
                }
                else
                {
                    ExTraceGlobals.HealthChecksTracer.TraceDebug((long)IgnoreTransientErrors.Failures.GetHashCode(), "IgnoreTransientError(): Error with key '{0}' is _NOT_ being ignored. It has now occurred {1} successive times, which exceeds the maximum {2} secs. Last pass time is: {3}. Start of Failures is: {4}. FailedDuration is: {5} secs. ", new object[]
                    {
                        errorKey,
                        checkFailureInfo.NumSuccessiveFailures,
                        num,
                        checkFailureInfo.LatestPass,
                        checkFailureInfo.StartOfFailures,
                        checkFailureInfo.FailedDurationSeconds
                    });
                }
            }
            checkFailureInfo.LastIgnoreTransientErrorValue = flag;
            return(flag);
        }