mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-15 05:24:14 +01:00
more fixes
This commit is contained in:
parent
7cfe273613
commit
0f718dbf43
1 changed files with 19 additions and 3 deletions
|
|
@ -47,14 +47,30 @@ public class UserPairCacheService : IHostedService
|
||||||
if (!_cache.TryGetValue(uid, out var cachedInfos))
|
if (!_cache.TryGetValue(uid, out var cachedInfos))
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Building full cache: Did not find PairData for {uid}:{otheruid}", uid, otheruid);
|
_logger.LogDebug("Building full cache: Did not find PairData for {uid}:{otheruid}", uid, otheruid);
|
||||||
_cache[uid] = cachedInfos = await BuildFullCache(dbContext, uid).ConfigureAwait(false);
|
try
|
||||||
|
{
|
||||||
|
_cache[uid] = cachedInfos = await BuildFullCache(dbContext, uid).ConfigureAwait(false);
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Error during full PairCache calculation of {uid}:{otheruid}", uid, otheruid);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!cachedInfos.TryGetValue(otheruid, out var info))
|
if (!cachedInfos.TryGetValue(otheruid, out var info))
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Building individual cache: Did not find PairData for {uid}:{otheruid}", uid, otheruid);
|
_logger.LogDebug("Building individual cache: Did not find PairData for {uid}:{otheruid}", uid, otheruid);
|
||||||
info = await BuildIndividualCache(dbContext, uid, otheruid).ConfigureAwait(false);
|
try
|
||||||
_cache[uid][otheruid] = info;
|
{
|
||||||
|
info = await BuildIndividualCache(dbContext, uid, otheruid).ConfigureAwait(false);
|
||||||
|
_cache[uid][otheruid] = info;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
_logger.LogError(ex, "Error during individual PairCache calculation of {uid}:{otheruid}", uid, otheruid);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return info;
|
return info;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue