mirror of
https://github.com/Caraxi/mare.client.git
synced 2025-12-12 18:27:24 +01:00
fixes performancecollector cleanup
This commit is contained in:
parent
0eab5632c0
commit
8ac6251179
1 changed files with 10 additions and 2 deletions
|
|
@ -36,9 +36,17 @@ public class PerformanceCollector : IDisposable
|
|||
|
||||
foreach (var entries in _performanceCounters.ToList())
|
||||
{
|
||||
if (entries.Value.ToList().Last().Item1.AddMinutes(10) < TimeOnly.FromDateTime(DateTime.Now))
|
||||
try
|
||||
{
|
||||
_performanceCounters.Remove(entries.Key, out _);
|
||||
var last = entries.Value.ToList().Last();
|
||||
if (last.Item1.AddMinutes(10) < TimeOnly.FromDateTime(DateTime.Now))
|
||||
{
|
||||
_performanceCounters.Remove(entries.Key, out _);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
_logger.LogDebug("Error removing performance counter {counter}", entries.Key);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue