Merge pull request #7822 from betagouv/unschedule-export-demarches-opendata

unschedule export demarches opendata
This commit is contained in:
krichtof 2022-09-30 07:41:22 +02:00 committed by GitHub
commit 335838cc26
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 4 deletions

View file

@ -1,7 +1,10 @@
class Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob < Cron::CronJob
include DatagouvCronSchedulableConcern
self.schedule_expression = "every month at 3:00"
def self.schedulable?
false
end
def perform(*args)
gzip_filepath = [
'tmp/',

View file

@ -28,13 +28,13 @@ RSpec.describe Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob, type: :job
describe '#schedulable?' do
context "when ENV['OPENDATA_ENABLED'] == 'enabled'" do
it 'is schedulable' do
it 'is not schedulable' do
ENV['OPENDATA_ENABLED'] = 'enabled'
expect(Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob.schedulable?).to be_truthy
expect(Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob.schedulable?).to be_falsy
end
end
context "when ENV['OPENDATA_ENABLED'] != 'enabled'" do
it 'is schedulable' do
it 'is not schedulable' do
ENV['OPENDATA_ENABLED'] = nil
expect(Cron::Datagouv::ExportAndPublishDemarchesPubliquesJob.schedulable?).to be_falsy
end