mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-03-25 01:14:43 +00:00
Trying to make the finish_tournament_204 rake job reliable
This commit is contained in:
@@ -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}..."
|
||||
|
||||
Reference in New Issue
Block a user