Try to reduce the number of external data fetches
Only fetch external data if the external_id is the current one and data is not yet fetched
This commit is contained in:
parent
21d5da379f
commit
d24ee27cac
2 changed files with 3 additions and 3 deletions
|
@ -1,6 +1,6 @@
|
|||
class ChampFetchExternalDataJob < ApplicationJob
|
||||
def perform(champ)
|
||||
if champ.external_id.present?
|
||||
def perform(champ, external_id)
|
||||
if champ.external_id == external_id && champ.data.nil?
|
||||
data = champ.fetch_external_data
|
||||
|
||||
if data.present?
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue