Skip to content

Commit

Permalink
Fix tqdm progressing on errors in recalculate
Browse files Browse the repository at this point in the history
  • Loading branch information
Syriiin committed Jun 3, 2024
1 parent 53821ef commit 4967d71
Showing 1 changed file with 2 additions and 2 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

0 comments on commit 4967d71

Please sign in to comment.