diff --git a/config/initializers/active_job_compatibility.rb b/config/initializers/active_job_compatibility.rb index a73482124..9a90cfe50 100644 --- a/config/initializers/active_job_compatibility.rb +++ b/config/initializers/active_job_compatibility.rb @@ -11,22 +11,24 @@ # - but let's keep these for a while to make external integrators's life easier. # To keep some margin, let's say this file can be safely deleted in May 2021.) -require 'excon' - Rails.application.reloader.to_prepare do - module ApiEntreprise - Job = APIEntreprise::Job - AssociationJob = APIEntreprise::AssociationJob - AttestationFiscaleJob = APIEntreprise::AttestationFiscaleJob - AttestationSocialeJob = APIEntreprise::AttestationSocialeJob - BilansBdfJob = APIEntreprise::BilansBdfJob - EffectifsAnnuelsJob = APIEntreprise::EffectifsAnnuelsJob - EffectifsJob = APIEntreprise::EffectifsJob - EntrepriseJob = APIEntreprise::EntrepriseJob - ExercicesJob = APIEntreprise::ExercicesJob - end + if !defined?(ApiEntreprise) + require 'excon' - module Cron - FixMissingAntivirusAnalysis = FixMissingAntivirusAnalysisJob + module ApiEntreprise + Job = APIEntreprise::Job + AssociationJob = APIEntreprise::AssociationJob + AttestationFiscaleJob = APIEntreprise::AttestationFiscaleJob + AttestationSocialeJob = APIEntreprise::AttestationSocialeJob + BilansBdfJob = APIEntreprise::BilansBdfJob + EffectifsAnnuelsJob = APIEntreprise::EffectifsAnnuelsJob + EffectifsJob = APIEntreprise::EffectifsJob + EntrepriseJob = APIEntreprise::EntrepriseJob + ExercicesJob = APIEntreprise::ExercicesJob + end + + module Cron + FixMissingAntivirusAnalysis = FixMissingAntivirusAnalysisJob + end end end