2021-02-09 12:35:23 +01:00
|
|
|
class ChampFetchExternalDataJob < ApplicationJob
|
2021-03-11 12:32:08 +01:00
|
|
|
def perform(champ, external_id)
|
|
|
|
if champ.external_id == external_id && champ.data.nil?
|
2021-02-09 12:35:23 +01:00
|
|
|
data = champ.fetch_external_data
|
|
|
|
|
|
|
|
if data.present?
|
|
|
|
champ.update!(data: data)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|