-
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 rake task to delete expired orcid tokens
- Loading branch information
Martin Fenner
committed
Jun 10, 2021
1 parent
4e8794e
commit 134fd4b
Showing
3 changed files
with
45 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,13 @@ | ||
class UserJob < ApplicationJob | ||
queue_as :volpino | ||
|
||
rescue_from ActiveJob::DeserializationError, ActiveRecord::ConnectionTimeoutError, Faraday::TimeoutError do | ||
retry_job wait: 5.minutes, queue: :volpino | ||
end | ||
|
||
def perform(user) | ||
ActiveRecord::Base.connection_pool.with_connection do | ||
user.update(orcid_expires_at: "1970-01-01", orcid_token: nil), | ||
end | ||
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