mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-13 20:44:16 +01:00
change stale data processing I guess
This commit is contained in:
parent
527b95a271
commit
5316daf7d8
1 changed files with 9 additions and 9 deletions
|
|
@ -134,10 +134,11 @@ public class UserPairCacheService : IHostedService
|
||||||
if (_staleUserData.Any())
|
if (_staleUserData.Any())
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Processing Stale Entries");
|
_logger.LogDebug("Processing Stale Entries");
|
||||||
try
|
|
||||||
{
|
|
||||||
using var dbContext = await _dbContextFactory.CreateDbContextAsync().ConfigureAwait(false);
|
using var dbContext = await _dbContextFactory.CreateDbContextAsync().ConfigureAwait(false);
|
||||||
while (_staleUserData.TryPeek(out var staleUserPair))
|
while (_staleUserData.TryDequeue(out var staleUserPair))
|
||||||
|
{
|
||||||
|
try
|
||||||
{
|
{
|
||||||
if (staleUserPair.UID == null)
|
if (staleUserPair.UID == null)
|
||||||
{
|
{
|
||||||
|
|
@ -175,15 +176,14 @@ public class UserPairCacheService : IHostedService
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_staleUserData.TryDequeue(out _);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
_logger.LogError(ex, "Error during Stale entry processing");
|
_logger.LogError(ex, "Error during Stale entry processing");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue