Skip to content

Commit

Permalink
fix: #dev async dbContext scope fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marcinbator committed Nov 23, 2024
1 parent d06ea83 commit 998c5ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ private void DeleteUnusedPasswordResetTokens()
private async void UpdateCachedStats()
{
var games = await _dbContext.Games.ToListAsync();
foreach (var game in games) _statsUtil.UpdateCachedGameStats(game);
foreach (var game in games) await _statsUtil.UpdateCachedGameStats(game);

_statsUtil.UpdateCachedStats();
await _statsUtil.UpdateCachedStats();

Console.WriteLine("Stats updated.");
}
Expand Down
2 changes: 1 addition & 1 deletion rag-2-backend/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
{
options.UseNpgsql(builder.Configuration.GetConnectionString("DefaultConnection"),
b => { b.EnableRetryOnFailure(5, TimeSpan.FromSeconds(10), null); });
});
}, ServiceLifetime.Transient);
builder.Services.AddSingleton<IConnectionMultiplexer>(
ConnectionMultiplexer.Connect(builder.Configuration.GetSection("Redis:ConnectionString").Value ?? "")
);
Expand Down

0 comments on commit 998c5ef

Please sign in to comment.