From 7d2cd7195bfc53a3bf2b57359fcfcb570813fe3d Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 11 Oct 2023 15:14:18 +0200 Subject: [PATCH] Add variable delay before link verification of remote account links (#27351) --- app/services/update_account_service.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/services/update_account_service.rb b/app/services/update_account_service.rb index 4604d71b2..a98f4d31e 100644 --- a/app/services/update_account_service.rb +++ b/app/services/update_account_service.rb @@ -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)