1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-07 06:54:16 +00:00

Removed single weight match generation, fixed bracket names, reload weight matches for pool order, and auto delete errrored jobs

This commit is contained in:
2024-12-16 00:02:30 -05:00
parent 5f049793c8
commit a851436c0c
12 changed files with 69 additions and 45 deletions

View File

@@ -14,6 +14,7 @@ class AdvanceWrestler
end
def advance_raw
@tournament.clear_errored_deferred_jobs
if @last_match && @last_match.finished?
pool_to_bracket_advancement if @tournament.tournament_type == "Pool to bracket"
DoubleEliminationAdvance.new(@wrestler, @last_match).bracket_advancement if @tournament.tournament_type.include? "Modified 16 Man Double Elimination" or

View File

@@ -29,6 +29,7 @@ class PoolOrder
def setOriginalPoints
@wrestlers.each do |w|
matches = w.matches.reload
w.pool_placement_tiebreaker = nil
w.pool_placement = nil
w.poolAdvancePoints = w.pool_wins.size

View File

@@ -12,6 +12,7 @@ class GenerateTournamentMatches
end
def generate_weight_raw(weight)
@tournament.clear_errored_deferred_jobs
WipeTournamentMatches.new(@tournament).wipeWeightMatches(weight)
@tournament.curently_generating_matches = 1
@tournament.save

View File

@@ -2,14 +2,6 @@ class PoolToBracketMatchGeneration
def initialize( tournament )
@tournament = tournament
end
def generatePoolToBracketMatchesWeight(weight)
PoolGeneration.new(weight).generatePools()
last_match = @tournament.matches.where(weight: weight).order(round: :desc).limit(1).first
highest_round = last_match.round
PoolBracketGeneration.new(weight, highest_round).generateBracketMatches()
setOriginalSeedsToWrestleLastPoolRound(weight)
end
def generatePoolToBracketMatches
@tournament.weights.order(:max).each do |weight|