Skip to content

Commit

Permalink
Merge pull request #65 from Syriiin/fix/recalcualte-pbar
Browse files Browse the repository at this point in the history
Fix/recalcualte pbar
  • Loading branch information
Syriiin authored Jun 3, 2024
2 parents 53821ef + 097979a commit bde723e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions profiles/management/commands/recalculate.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,14 @@ def recalculate_beatmaps_v2(
while len(page := beatmaps_to_recalculate[:2000]) > 0:
try:
update_difficulty_calculations(page, difficulty_calculator)
pbar.update(len(page))
except CalculationException as e:
ErrorReporter().report_error(e)
pbar.write(
self.style.ERROR(
f"Error calculating difficulty values for beatmaps: {e}"
)
)
pbar.update(len(page))

self.stdout.write(
self.style.SUCCESS(
Expand Down Expand Up @@ -357,14 +357,14 @@ def recalculate_scores_v2(
unique_beatmap_scores,
difficulty_calculator,
)
pbar.update(unique_beatmap_scores.count())
except CalculationException as e:
ErrorReporter().report_error(e)
pbar.write(
self.style.ERROR(
f"Error calculating performance values for beatmap {unique_beatmap['beatmap_id']} with mods {unique_beatmap['mods']}: {e}"
)
)
pbar.update(unique_beatmap_scores.count())

self.stdout.write(
self.style.SUCCESS(
Expand Down
2 changes: 1 addition & 1 deletion profiles/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -649,9 +649,9 @@ def calculate_difficulty_values(
name=name,
value=value,
)
for name, value in result.difficulty_values.items()
]
for difficulty_calculation, result in zip(difficulty_calculations, results)
for name, value in result.difficulty_values.items()
]

return values
Expand Down

0 comments on commit bde723e

Please sign in to comment.