-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add task for importing missing by empty attribute
Ref #196
- Loading branch information
1 parent
9c259d8
commit 1310ae8
Showing
3 changed files
with
72 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
class DoiImportOneJob < ActiveJob::Base | ||
queue_as :lupo_background | ||
|
||
rescue_from(Elasticsearch::Transport::Transport::Errors::BadRequest) do |e| | ||
logger = Logger.new(STDOUT) | ||
logger.info("[Import DOI] Failed to index a doi, exception was: " + e.message) | ||
end | ||
|
||
def perform(doi) | ||
logger = Logger.new(STDOUT) | ||
logger.info("[Import DOI] Attempting to import doi: " + doi) | ||
Doi.import_one(doi_id: doi) | ||
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
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