about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
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