config: fix zeitwekr warning when reloading the app

Turns out we need not only to load the Job constants later, but also
not to do the same work twice – otherwise we'll get a 

> ApiEntreprise::Job constant is already defined

when attempting to re-define the constant.
This commit is contained in:
Pierre de La Morinerie 2021-02-24 19:01:27 +01:00
parent 9f676c76e1
commit d36a684315

View file

@ -11,22 +11,24 @@
# - but let's keep these for a while to make external integrators's life easier. # - 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.) # To keep some margin, let's say this file can be safely deleted in May 2021.)
require 'excon'
Rails.application.reloader.to_prepare do Rails.application.reloader.to_prepare do
module ApiEntreprise if !defined?(ApiEntreprise)
Job = APIEntreprise::Job require 'excon'
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 module ApiEntreprise
FixMissingAntivirusAnalysis = FixMissingAntivirusAnalysisJob 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
end end