1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-03 20:47:52 +00:00

Job concurrency per tournament is 1 so we don't have to scale too much on active queue. Pages no longer refresh automatically after navigating away from the bout board. Tournament backups are no longer deleted when restoring from a backup. Cloudflare is blocking manual backup imports so I have deleted that form on the backups page.

This commit is contained in:
2026-01-16 18:21:17 -05:00
parent 52df73d14f
commit 940f7b1d00
10 changed files with 32 additions and 20 deletions

View File

@@ -1,7 +1,9 @@
class AdvanceWrestlerJob < ApplicationJob
queue_as :default
# associations are not available here so we had to pass tournament_id when creating the job
limits_concurrency to: 1, key: ->(_wrestler, _match, tournament_id) { "tournament:#{tournament_id}" }
def perform(wrestler, match)
def perform(wrestler, match, tournament_id)
# Get tournament from wrestler
tournament = wrestler.tournament
@@ -29,4 +31,4 @@ class AdvanceWrestlerJob < ApplicationJob
raise e
end
end
end
end

View File

@@ -1,5 +1,6 @@
class CalculateSchoolScoreJob < ApplicationJob
queue_as :default
limits_concurrency to: 1, key: ->(school) { "tournament:#{school.tournament_id}" }
# Need for TournamentJobStatusIntegrationTest
def self.perform_sync(school)
@@ -35,4 +36,4 @@ class CalculateSchoolScoreJob < ApplicationJob
raise e
end
end
end
end

View File

@@ -1,5 +1,6 @@
class GenerateTournamentMatchesJob < ApplicationJob
queue_as :default
limits_concurrency to: 1, key: ->(tournament) { "tournament:#{tournament.id}" }
def perform(tournament)
# Log information about the job
@@ -17,4 +18,4 @@ class GenerateTournamentMatchesJob < ApplicationJob
raise # Re-raise the error so it's properly recorded
end
end
end
end

View File

@@ -1,5 +1,6 @@
class TournamentBackupJob < ApplicationJob
queue_as :default
limits_concurrency to: 1, key: ->(tournament) { "tournament:#{tournament.id}" }
def perform(tournament, reason = nil)
# Log information about the job
@@ -29,4 +30,4 @@ class TournamentBackupJob < ApplicationJob
raise e
end
end
end
end

View File

@@ -1,5 +1,6 @@
class WrestlingdevImportJob < ApplicationJob
queue_as :default
limits_concurrency to: 1, key: ->(tournament) { "tournament:#{tournament.id}" }
def perform(tournament, import_data = nil)
# Log information about the job
@@ -30,4 +31,4 @@ class WrestlingdevImportJob < ApplicationJob
raise e
end
end
end
end