We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3d09d49 commit 579085eCopy full SHA for 579085e
src/System.Linq.Dynamic.Core/Parser/ThreadSafeSlidingCache.cs
@@ -66,14 +66,17 @@ private void CleanupIfNeeded()
66
{
67
if (DateTime.UtcNow - _lastCleanupTime > _cleanupFrequency)
68
69
+ // Set here, so we don't have re-entry due to large collection enumeration.
70
+ _lastCleanupTime = DateTime.UtcNow;
71
+
72
foreach (var key in _cache.Keys)
73
74
if (DateTime.UtcNow > _cache[key].ExpirationTime)
75
76
_cache.TryRemove(key, out _);
77
}
78
- _lastCleanupTime = DateTime.UtcNow;
79
80
81
82
0 commit comments