mirror of
https://github.com/Caraxi/mare.server.git
synced 2025-12-16 01:34:16 +01:00
reuse dbcontext where applicable
This commit is contained in:
parent
0f718dbf43
commit
527b95a271
4 changed files with 8 additions and 9 deletions
|
|
@ -25,7 +25,7 @@ public class UserPairCacheService : IHostedService
|
|||
_cache.TryRemove(uid, out _);
|
||||
}
|
||||
|
||||
public async Task<Dictionary<string, UserInfo>> GetAllPairs(string uid)
|
||||
public async Task<Dictionary<string, UserInfo>> GetAllPairs(string uid, MareDbContext dbContext)
|
||||
{
|
||||
await WaitForProcessing(uid).ConfigureAwait(false);
|
||||
|
||||
|
|
@ -33,7 +33,6 @@ public class UserPairCacheService : IHostedService
|
|||
{
|
||||
_logger.LogDebug("Building full cache: Did not find PairData for {uid}", uid);
|
||||
|
||||
using var dbContext = await _dbContextFactory.CreateDbContextAsync().ConfigureAwait(false);
|
||||
_cache[uid] = await BuildFullCache(dbContext, uid).ConfigureAwait(false);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue