Add variable delay before link verification of remote account links (#27351)

shrike
Claire 2023-10-11 15:14:18 +02:00 committed by GitHub
parent 27e84c0691
commit 7d2cd7195b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -28,7 +28,13 @@ class UpdateAccountService < BaseService
end
def check_links(account)
VerifyAccountLinksWorker.perform_async(account.id) if account.fields.any?(&:requires_verification?)
return unless account.fields.any?(&:requires_verification?)
if account.local?
VerifyAccountLinksWorker.perform_async(account.id)
else
VerifyAccountLinksWorker.perform_in(rand(10.minutes.to_i), account.id)
end
end
def process_hashtags(account)