From cd772680701ea5517132512a6ea02e6511493d4e Mon Sep 17 00:00:00 2001 From: Jacob Cody Wimer Date: Mon, 15 Sep 2025 18:28:35 -0400 Subject: [PATCH] Trying to make the finish_tournament_204 rake job reliable --- lib/tasks/finish_tournament_204.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/finish_tournament_204.rake b/lib/tasks/finish_tournament_204.rake index bae3d20..01b4f61 100644 --- a/lib/tasks/finish_tournament_204.rake +++ b/lib/tasks/finish_tournament_204.rake @@ -35,8 +35,8 @@ namespace :tournament do end @tournament.reload # Ensure matches association is fresh before iterating - @tournament.matches.sort_by(&:bout_number).each do |match| - if match.reload.loser1_name != "BYE" and match.reload.loser2_name != "BYE" && match.reload.finished != 1 + @tournament.matches.reload.sort_by(&:bout_number).each do |match| + if match.reload.loser1_name != "BYE" and match.reload.loser2_name != "BYE" and match.reload.finished != 1 # Wait until both wrestlers are assigned while (match.w1.nil? || match.w2.nil?) puts "Waiting for wrestlers in match #{match.bout_number}..."