Implement Device Cache to replace EFCoreSecondLevelCacheInterceptor

The EFCoreSecondLevelCacheInterceptor will place a huge lock even for reading. Implement a ConcurrentDictionary cache to replace it.

Signed-off-by: gnattu <gnattuoc@me.com>
This commit is contained in:
gnattu
2024-06-01 08:01:54 +08:00
parent f7a90b6383
commit 5a62c7a146
8 changed files with 133 additions and 122 deletions

View File

@@ -60,10 +60,10 @@ public sealed class DeviceAccessHost : IHostedService
private async Task UpdateDeviceAccess(User user)
{
var existing = (await _deviceManager.GetDevices(new DeviceQuery
var existing = _deviceManager.GetDevices(new DeviceQuery
{
UserId = user.Id
}).ConfigureAwait(false)).Items;
}).Items;
foreach (var device in existing)
{