From 22b7b2ab8b01a5ae30905bc80234e3b204d79a88 Mon Sep 17 00:00:00 2001 From: Fosco Marotto Date: Thu, 4 Feb 2021 13:48:50 -0500 Subject: [PATCH] Disable unused DistributionWorker and activity:interactions --- app/services/favourite_service.rb | 2 +- app/services/follow_service.rb | 2 +- app/services/post_status_service.rb | 4 ++-- app/services/process_quote_service.rb | 11 +++++------ app/services/reblog_service.rb | 4 ++-- app/services/vote_service.rb | 2 +- 6 files changed, 12 insertions(+), 13 deletions(-) diff --git a/app/services/favourite_service.rb b/app/services/favourite_service.rb index 0c4edaf3..0f3af636 100644 --- a/app/services/favourite_service.rb +++ b/app/services/favourite_service.rb @@ -39,7 +39,7 @@ class FavouriteService < BaseService end def bump_potential_friendship(account, status) - ActivityTracker.increment('activity:interactions') + # ActivityTracker.increment('activity:interactions') return if account.following?(status.account_id) PotentialFriendshipTracker.record(account.id, status.account_id, :favourite) end diff --git a/app/services/follow_service.rb b/app/services/follow_service.rb index fb714f2e..414ce686 100644 --- a/app/services/follow_service.rb +++ b/app/services/follow_service.rb @@ -26,7 +26,7 @@ class FollowService < BaseService return end - ActivityTracker.increment('activity:interactions') + # ActivityTracker.increment('activity:interactions') if target_account.locked? request_follow(source_account, target_account, reblogs: reblogs) diff --git a/app/services/post_status_service.rb b/app/services/post_status_service.rb index c360c65d..6b057e10 100644 --- a/app/services/post_status_service.rb +++ b/app/services/post_status_service.rb @@ -118,7 +118,7 @@ class PostStatusService < BaseService def postprocess_status! LinkCrawlWorker.perform_async(@status.id) - DistributionWorker.perform_async(@status.id) + # DistributionWorker.perform_async(@status.id) ExpiringStatusWorker.perform_at(@status.expires_at, @status.id) if @status.expires_at && @account.is_pro PollExpirationNotifyWorker.perform_at(@status.poll.expires_at, @status.poll.id) if @status.poll end @@ -214,7 +214,7 @@ class PostStatusService < BaseService def bump_potential_friendship! return if !@status.reply? || @account.id == @status.in_reply_to_account_id - ActivityTracker.increment('activity:interactions') + # ActivityTracker.increment('activity:interactions') return if @account.following?(@status.in_reply_to_account_id) PotentialFriendshipTracker.record(@account.id, @status.in_reply_to_account_id, :reply) end diff --git a/app/services/process_quote_service.rb b/app/services/process_quote_service.rb index fc0ca193..d0618766 100644 --- a/app/services/process_quote_service.rb +++ b/app/services/process_quote_service.rb @@ -8,9 +8,9 @@ class ProcessQuoteService < BaseService create_notification(status) bump_potential_friendship(status) end - + private - + def create_notification(status) quoted_status = status.quote @@ -18,12 +18,11 @@ class ProcessQuoteService < BaseService LocalNotificationWorker.perform_async(quoted_status.account_id, status.id, status.class.name) end end - + def bump_potential_friendship(status) - ActivityTracker.increment('activity:interactions') + # ActivityTracker.increment('activity:interactions') return if status.account.following?(status.quote.account_id) PotentialFriendshipTracker.record(status.account_id, status.quote.account_id, :reblog) end - + end - \ No newline at end of file diff --git a/app/services/reblog_service.rb b/app/services/reblog_service.rb index 0c1bef8c..025d8121 100644 --- a/app/services/reblog_service.rb +++ b/app/services/reblog_service.rb @@ -28,7 +28,7 @@ class ReblogService < BaseService text = options[:status] || '' reblog = account.statuses.create!(reblog: reblogged_status, text: text, visibility: visibility) - DistributionWorker.perform_async(reblog.id) + # DistributionWorker.perform_async(reblog.id) create_notification(reblog) bump_potential_friendship(account, reblog) @@ -47,7 +47,7 @@ class ReblogService < BaseService end def bump_potential_friendship(account, reblog) - ActivityTracker.increment('activity:interactions') + # ActivityTracker.increment('activity:interactions') return if account.following?(reblog.reblog.account_id) PotentialFriendshipTracker.record(account.id, reblog.reblog.account_id, :reblog) end diff --git a/app/services/vote_service.rb b/app/services/vote_service.rb index 816a61d2..0d6164ce 100644 --- a/app/services/vote_service.rb +++ b/app/services/vote_service.rb @@ -17,7 +17,7 @@ class VoteService < BaseService end end - ActivityTracker.increment('activity:interactions') + # ActivityTracker.increment('activity:interactions') end end