Sync with external providers (Opta, Chyron, Keytoq etc.)
Sync match statistics
Find match id/slug from frontend URL: https://www.ekstraklasa.org/centrum-meczowe/ekstraklasa-sezon-2024-2025-runda-zasadnicza-kolejka-23-zaglebie-lubin-2024-2025-piast-gliwice-2024-25/2214/po-meczu/relacja
or CMS match page (Competitions -> Schedule): https://umpire.ekstraklasa.org/competitions/matches/form/2214
match = Match.find(2214)
API::V3::SyncMatchStatisticsJob.perform_async({ client_identifier: 'EKSTRAKLASA', match_id: match.id, live_data: true, skip_delay_check: true }.stringify_keys)
Stats should be updated quickly, in few seconds. Verify them at FE match stats page:
For older matches (finished long time ago) we may want to use live_data: false or omit this param entirely to sync data from Chyron successfully.
Sync players season stats
Sync players stats for given competition season and provider
Find competition season id (eg. 133):
job_args = {"client_identifier"=>"EKSTRAKLASA", "context_type"=>"CompetitionSeason", "resource_type"=>"SquadPlayer", "provider"=>"opta", "context_id"=>133, "skip_delay_check" => true}.stringify_keys
API::V3::SyncStatisticsFromProviderJob.perform_async(job_args)
one can also run sync job synchronously in rails console instead of Sidekiq - this way we see immediately when job is done:
API::V3::SyncStatisticsFromProviderJob.new.perform(job_args)
Run the same command for other providers (eg. 'chyron')
These stats take quite a while to update (5-10 minutes or so). Verify on:
https://www.ekstraklasa.org/statystyki/indywidualne
and:
https://www.ekstraklasa.org/statystyki/druzynowe
Sync players stats for all competition seasons and providers
job_args = { client_identifier: 'EKSTRAKLASA', context_type: 'CompetitionSeason', resource_type: 'SquadPlayer' }.stringify_keys
API::V3::SyncStatisticsJob.perform_async(job_args)
one can also run sync job synchronously in rails console instead of Sidekiq - this way we see immediately when job is done:
API::V3::SyncStatisticsJob.new.perform(job_args)
this job would perform sync with all providers, for all current competition seasons (for seasons with is_current: true) under the hood, so performing what is descibed in 'Sync players stats for given competition season and provider' section.