1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-03-25 01:14:43 +00:00

Fixed finish_tournament_204.rake

This commit is contained in:
2025-09-15 18:57:29 -04:00
parent c5b9783853
commit 15f85e439c

View File

@@ -27,13 +27,14 @@ namespace :tournament do
) )
GenerateTournamentMatches.new(@tournament).generate GenerateTournamentMatches.new(@tournament).generate
sleep(10) sleep(60)
while @tournament.reload.curently_generating_matches == 1 while @tournament.reload.curently_generating_matches == 1
puts "Waiting for tournament to finish generating matches..." puts "Waiting for tournament to finish generating matches..."
sleep(5) sleep(5)
@tournament.reload @tournament.reload
end end
sleep(10)
@tournament.reload # Ensure matches association is fresh before iterating @tournament.reload # Ensure matches association is fresh before iterating
@tournament.matches.reload.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" and match.reload.finished != 1 if match.reload.loser1_name != "BYE" and match.reload.loser2_name != "BYE" and match.reload.finished != 1