-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add utilities module and functions for reindexing
- Loading branch information
1 parent
c1cd401
commit 4e64bb4
Showing
3 changed files
with
68 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
defmodule DpulCollections.Utilities do | ||
alias DpulCollections.IndexingPipeline | ||
alias DpulCollections.IndexingPipeline.Figgy | ||
|
||
def reindex_solr(cache_version) do | ||
indexing_processor_marker = | ||
IndexingPipeline.get_processor_marker!("figgy_indexer", cache_version) | ||
|
||
IndexingPipeline.delete_processor_marker(indexing_processor_marker) | ||
# When the consumer is stopped, it supervisor restarts it immediately. | ||
# This resets the state and last queried marker. | ||
GenServer.stop(Figgy.IndexingConsumer) | ||
end | ||
|
||
def reindex_transformation_cache(cache_version) do | ||
transformation_processor_marker = | ||
IndexingPipeline.get_processor_marker!("figgy_transformer", cache_version) | ||
|
||
IndexingPipeline.delete_processor_marker(transformation_processor_marker) | ||
GenServer.stop(Figgy.TransformationConsumer) | ||
end | ||
|
||
def reindex_hydration_cache(cache_version) do | ||
hydration_processor_marker = | ||
IndexingPipeline.get_processor_marker!("hydrator", cache_version) | ||
|
||
IndexingPipeline.delete_processor_marker(hydration_processor_marker) | ||
GenServer.stop(Figgy.HydrationConsumer) | ||
end | ||
|
||
def reindex_all(cache_version) do | ||
reindex_hydration_cache(cache_version) | ||
reindex_transformation_cache(cache_version) | ||
reindex_solr(cache_version) | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters