about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authormultiple creatures <dev@multiple-creature.party>2019-12-10 00:34:58 -0600
committermultiple creatures <dev@multiple-creature.party>2019-12-10 02:36:38 -0600
commit002fb7fbb7f7a3d3b4fa2c6a1d72c3384fcfc20b (patch)
tree0e5de341d916c3a9f2aaf162156fed7363572e5c /app/workers
parent0512709a77977ea0ffc759d0f9411757c09404a5 (diff)
synchronize remote posts on first follow
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/sync_remote_account_worker.rb12
1 files changed, 12 insertions, 0 deletions
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