-
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.
- Loading branch information
Martin Fenner
committed
Aug 23, 2020
1 parent
434c19d
commit 879fddf
Showing
2 changed files
with
28 additions
and
0 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,16 @@ | ||
class DoiRefreshJob < ActiveJob::Base | ||
queue_as :lupo_background | ||
|
||
# retry_on ActiveRecord::Deadlocked, wait: 10.seconds, attempts: 3 | ||
# retry_on Faraday::TimeoutError, wait: 10.minutes, attempts: 3 | ||
|
||
# discard_on ActiveJob::DeserializationError | ||
|
||
rescue_from ActiveJob::DeserializationError, Elasticsearch::Transport::Transport::Errors::BadRequest do |error| | ||
Rails.logger.error error.message | ||
end | ||
|
||
def perform(id, options={}) | ||
Event.import_doi(id, options.merge(refresh: true)) | ||
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