Skip to content

Commit

Permalink
Merge branch 'feature/local-image-harvest-task' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
ewlarson committed Nov 6, 2023
2 parents 07d404d + cba2dd4 commit 10745b3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
2 changes: 1 addition & 1 deletion config/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end
# Harvest thumbnail images for search results
every :day, at: '12:05am', roles: [:app] do
rake 'gblsci:images:harvest_retry'
rake 'geoportal:queue_incomplete_states'
end
every :day, at: '12:30am', roles: [:app] do
rake 'sitemap:refresh'
Expand Down
20 changes: 19 additions & 1 deletion lib/tasks/geoportal/geoportal_images.rake
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,25 @@ namespace :geoportal do

desc 'Harvest images - Queue incomplete states for reprocessing'
task queue_incomplete_states: :environment do
puts "Deprecated / Instead try: bundle exec rake gblsci:images:harvest_retry"
# Skipping :failed, :placeheld
states = [
:initialized,
:queued,
:processing
]

states.each do |state|
sidecars = SolrDocumentSidecar.in_state(state)

puts "#{state} - #{sidecars.size}"

sidecars.each do |sc|
document = Geoblacklight::SolrDocument.find(sc.document_id)
GeoblacklightSidecarImages::StoreImageJob.perform_later(document.id)
rescue
puts "orphaned / #{sc.document_id}"
end
end
end

desc 'Failed State - Inspect metadata'
Expand Down

0 comments on commit 10745b3

Please sign in to comment.