From bac9e0b55d77257b9b9d8ce602ca79c3885a9d18 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 13 Nov 2023 17:17:05 +0100 Subject: [PATCH] Add variable delay before link verification of remote account links (#27774) --- app/services/activitypub/process_account_service.rb | 2 +- app/services/update_account_service.rb | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/app/services/activitypub/process_account_service.rb b/app/services/activitypub/process_account_service.rb index 1304ca8242..8fc0989a3f 100644 --- a/app/services/activitypub/process_account_service.rb +++ b/app/services/activitypub/process_account_service.rb @@ -180,7 +180,7 @@ class ActivityPub::ProcessAccountService < BaseService end def check_links! - VerifyAccountLinksWorker.perform_async(@account.id) + VerifyAccountLinksWorker.perform_in(rand(10.minutes.to_i), @account.id) end def process_duplicate_accounts! diff --git a/app/services/update_account_service.rb b/app/services/update_account_service.rb index a98f4d31e4..1bbcfce3ea 100644 --- a/app/services/update_account_service.rb +++ b/app/services/update_account_service.rb @@ -30,11 +30,7 @@ class UpdateAccountService < BaseService def check_links(account) 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 + VerifyAccountLinksWorker.perform_async(account.id) end def process_hashtags(account)