Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Valkyrize the reindexer jobs #2147

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion app/jobs/reindex_admin_sets_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

class ReindexAdminSetsJob < ApplicationJob
def perform
AdminSet.find_each(&:update_index)
AdministrativeSet.find_each do |admin_set|
Copy link
Collaborator Author

@laritakr laritakr Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed to use the config admin set class. Possibly should also reference multiple models?

ReindexItemJob.perform_later(admin_set)
end
end
end
2 changes: 1 addition & 1 deletion app/jobs/reindex_collections_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

class ReindexCollectionsJob < ApplicationJob
def perform
Collection.find_each do |collection|
PcdmCollection.find_each do |collection|
Copy link
Collaborator Author

@laritakr laritakr Feb 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to be changed to use the config collection class. Possibly should also reference multiple models?

ReindexItemJob.perform_later(collection)
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/jobs/reindex_item_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@

class ReindexItemJob < ApplicationJob
def perform(item)
item.update_index
Hyrax.index_adapter.save(resource: item)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Hyrax.index_adapter.save(resource: item)
Hyrax.query_service.find_all_of_model(model: item.class).each do |resource|
Hyrax.index_adapter.save(resource: item)
end

Should this turn into the above, based on our convo with Rob? Would this work if there are existing active fedora objects?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have to blow away my env to confirm ^^ checking now though...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was the error i received:
image

end
end
Loading