Skip to content

Commit

Permalink
Fix ComboRatings GetComboDsstatsCalcDtos
Browse files Browse the repository at this point in the history
  • Loading branch information
ipax77 committed Jul 16, 2024
1 parent fcfd13f commit 6b425d4
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
10 changes: 2 additions & 8 deletions src/dsstats.ratings/ComboRatings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,14 @@ public async Task CombineDsstatsSc2ArcadeReplays()
int matches = 0;
var dsstatsReplays = await GetComboDsstatsCalcDtos(dsstatsRequest, context);
int dsstatsReplaysCount = dsstatsReplays.Count;
int i = 0;
List<ReplayArcadeMatch> replayMatches = [];
while (dsstatsReplays.Count > 0)
{
i++;
dsstatsReplays = dsstatsReplays.Where(x => !matchesInfo.ReplayDict.ContainsKey(x.ReplayId))
.ToList();
await InitArcadeRep(dsstatsReplays);


List<ReplayArcadeMatch> replayMatches = [];

foreach (var dsstatsReplay in dsstatsReplays)
{
Expand All @@ -76,11 +74,6 @@ public async Task CombineDsstatsSc2ArcadeReplays()
matches++;
}
}
await StoreReplayMatches(replayMatches);
// if (i > 19)
// {
// break;
// }
logger.LogInformation("Matches: {matches}/{total} ({percentage}%)", matches,
dsstatsReplaysCount, dsstatsReplaysCount > 0 ? Math.Round(matches * 100.0 / (double)dsstatsReplaysCount, 2) : 0);

Expand All @@ -90,6 +83,7 @@ public async Task CombineDsstatsSc2ArcadeReplays()
RegionDict.Clear();
ToonIdsDict.Clear();
}
await StoreReplayMatches(replayMatches);
sw.Stop();
logger.LogWarning("Matches: {matches}/{total} ({percentage}%) in {elapsed}sec", matches,
dsstatsReplaysCount, dsstatsReplaysCount > 0 ? Math.Round(matches * 100.0 / (double)dsstatsReplaysCount, 2) : 0,
Expand Down
2 changes: 1 addition & 1 deletion src/dsstats.ratings/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ static void Main(string[] args)
services.AddLogging(options =>
{
options.SetMinimumLevel(LogLevel.Information);
options.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.Warning);
options.AddFilter("Microsoft.EntityFrameworkCore", LogLevel.Information);
options.AddConsole();
});

Expand Down

0 comments on commit 6b425d4

Please sign in to comment.