Skip to content

Commit

Permalink
Merge pull request #2141 from alphagov/update-rake-task
Browse files Browse the repository at this point in the history
Allow to run etl:rerun_main for a single date
  • Loading branch information
AgaDufrat authored Oct 23, 2024
2 parents d3998ac + 508414b commit dff14d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/tasks/etl.rake
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,13 @@ namespace :etl do
end
end

desc "Run ETL Main process across a range of dates"
desc "Run ETL Main process across a range of dates or a single date"
task :rerun_main, %i[from to] => [:environment] do |_t, args|
from = args[:from].to_date
to = args[:to].to_date
to = args[:to]&.to_date
date_range = (from..to)
date_range.each do |date|

date_range.compact.each do |date|
puts "Running Etl::Main process for #{date}"
unless Etl::Main::MainProcessor.process(date:)
abort("Etl::Main::MainProcessor failed")
Expand Down

0 comments on commit dff14d5

Please sign in to comment.