Fix follower sync E2E helper
This commit is contained in:
parent
d86a2a3f5f
commit
8ab53fa854
|
|
@ -6,6 +6,8 @@ class TournamentSyncProcessor
|
||||||
end
|
end
|
||||||
|
|
||||||
def process_due!
|
def process_due!
|
||||||
|
return unless queue_table_available?
|
||||||
|
|
||||||
loop do
|
loop do
|
||||||
entry = next_entry
|
entry = next_entry
|
||||||
break if entry.nil?
|
break if entry.nil?
|
||||||
|
|
@ -30,4 +32,10 @@ class TournamentSyncProcessor
|
||||||
rescue TournamentSyncPusher::SyncFailed => e
|
rescue TournamentSyncPusher::SyncFailed => e
|
||||||
entry.reload.schedule_retry!(e.message)
|
entry.reload.schedule_retry!(e.message)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def queue_table_available?
|
||||||
|
TournamentSyncQueueEntry.connection.data_source_exists?(TournamentSyncQueueEntry.table_name)
|
||||||
|
rescue ActiveRecord::ActiveRecordError, PG::Error
|
||||||
|
false
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -199,7 +199,7 @@ RSpec.describe 'Tournament follower sync HTTP E2E' do
|
||||||
.uniq { |team| team.fetch(:id) }
|
.uniq { |team| team.fetch(:id) }
|
||||||
.sort_by { |team| team.fetch(:name) }
|
.sort_by { |team| team.fetch(:name) }
|
||||||
.each_with_index
|
.each_with_index
|
||||||
.to_h { |(team, index)| [index + 1, team] }
|
.to_h { |team, index| [index + 1, team] }
|
||||||
end
|
end
|
||||||
|
|
||||||
def play_group_match!(group, team_a, team_b, score_a, score_b)
|
def play_group_match!(group, team_a, team_b, score_a, score_b)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue