From 002fb7fbb7f7a3d3b4fa2c6a1d72c3384fcfc20b Mon Sep 17 00:00:00 2001 From: multiple creatures Date: Tue, 10 Dec 2019 00:34:58 -0600 Subject: synchronize remote posts on first follow --- app/workers/sync_remote_account_worker.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/workers/sync_remote_account_worker.rb (limited to 'app/workers') diff --git a/app/workers/sync_remote_account_worker.rb b/app/workers/sync_remote_account_worker.rb new file mode 100644 index 000000000..5c1f5fabd --- /dev/null +++ b/app/workers/sync_remote_account_worker.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class SyncRemoteAccountWorker + include Sidekiq::Worker + + def perform(account_id) + account = Account.find(account_id) + ActivityPub::FetchAccountStatusesService.new.call(account) + rescue ActiveRecord::RecordNotFound, ActiveRecord::RecordInvalid + true + end +end -- cgit