diff --git a/Application/Misc/ServerDataViewer.cs b/Application/Misc/ServerDataViewer.cs index 1aec2b5d..3a0bdabf 100644 --- a/Application/Misc/ServerDataViewer.cs +++ b/Application/Misc/ServerDataViewer.cs @@ -176,7 +176,7 @@ namespace IW4MAdmin.Application.Misc .Where(rating => rating.Client.Level != EFClient.Permission.Banned) .Where(rating => rating.Ranking != null) .CountAsync(cancellationToken); - }, nameof(_rankedClientsCache), serverId is null ? null: new[] { (object)serverId }, _cacheTimeSpan, true); + }, nameof(_rankedClientsCache), serverId is null ? null: new[] { (object)serverId }, _cacheTimeSpan); try { diff --git a/Data/Helpers/DataValueCache.cs b/Data/Helpers/DataValueCache.cs index 6832029f..0765cf89 100644 --- a/Data/Helpers/DataValueCache.cs +++ b/Data/Helpers/DataValueCache.cs @@ -18,6 +18,7 @@ namespace Data.Helpers private readonly IDatabaseContextFactory _contextFactory; private readonly ConcurrentDictionary>> _cacheStates = new(); + private readonly object _defaultKey = new(); private bool _autoRefresh; private const int DefaultExpireMinutes = 15; @@ -58,7 +59,7 @@ namespace Data.Helpers public void SetCacheItem(Func, CancellationToken, Task> getter, string key, IEnumerable ids = null, TimeSpan? expirationTime = null, bool autoRefresh = false) { - ids ??= new[] { new object() }; + ids ??= new[] { _defaultKey }; if (!_cacheStates.ContainsKey(key)) {