1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-24 17:04:43 +00:00

Trying to make the finish_tournament_204 rake job reliable

This commit is contained in:
2025-09-15 18:28:35 -04:00
parent d61ed80287
commit cd77268070

View File

@@ -35,8 +35,8 @@ namespace :tournament do
end end
@tournament.reload # Ensure matches association is fresh before iterating @tournament.reload # Ensure matches association is fresh before iterating
@tournament.matches.sort_by(&:bout_number).each do |match| @tournament.matches.reload.sort_by(&:bout_number).each do |match|
if match.reload.loser1_name != "BYE" and match.reload.loser2_name != "BYE" && match.reload.finished != 1 if match.reload.loser1_name != "BYE" and match.reload.loser2_name != "BYE" and match.reload.finished != 1
# Wait until both wrestlers are assigned # Wait until both wrestlers are assigned
while (match.w1.nil? || match.w2.nil?) while (match.w1.nil? || match.w2.nil?)
puts "Waiting for wrestlers in match #{match.bout_number}..." puts "Waiting for wrestlers in match #{match.bout_number}..."