internal bool IsStable(Type type) { if (TypeFailures.ContainsKey(type)) { return(TypeFailures[type].Count < ErrorCount); } return(true); }
internal void AddFailure(Type type) { if (TypeFailures.ContainsKey(type)) { TypeFailures[type].Add(DateTimeOffset.Now); } else { TypeFailures[type] = new List <DateTimeOffset> { DateTimeOffset.Now }; } // Trim the expired events TypeFailures[type].RemoveAll(x => x < DateTimeOffset.Now.Subtract(ErrorWindow)); }