Skip to content

Commit

Permalink
nil check
Browse files Browse the repository at this point in the history
  • Loading branch information
davidcam-src committed Jun 11, 2024
1 parent 094e25a commit b56ded1
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/tasks/dimensions_ingest.rake
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ namespace :dimensions do

# Read the last run time from a file
last_run_time = Date.parse(read_last_run_time('dimensions_ingest')) rescue nil
formatted_last_run_time = last_run_time.strftime('%Y-%m-%d')
formatted_last_run_time = last_run_time ? last_run_time.strftime('%Y-%m-%d') : nil

if last_run_time
Rails.logger.info "Last ingest run was at: #{last_run_time}"
formatted_last_run_time = last_run_time.strftime('%Y-%m-%d')
else
Rails.logger.info 'No previous run time found. Starting from default date. (1970-01-01)'
end
Expand Down

0 comments on commit b56ded1

Please sign in to comment.