Raise Mastodon::RaceConditionError if Redis lock failed (#7511)
An explicit error allows user agents to know the error and Sidekiq to retry.
This commit is contained in:
committed by
Eugen Rochko
parent
65d6b253fb
commit
55fd55714a
@@ -23,6 +23,8 @@ class FetchLinkCardService < BaseService
|
||||
if lock.acquired?
|
||||
@card = PreviewCard.find_by(url: @url)
|
||||
process_url if @card.nil? || @card.updated_at <= 2.weeks.ago
|
||||
else
|
||||
raise Mastodon::RaceConditionError
|
||||
end
|
||||
end
|
||||
|
||||
|
Reference in New Issue
Block a user