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/block_worker.rb9
-rw-r--r--app/workers/merge_worker.rb9
-rw-r--r--app/workers/unmerge_worker.rb9
3 files changed, 27 insertions, 0 deletions
diff --git a/app/workers/block_worker.rb b/app/workers/block_worker.rb
new file mode 100644
index 000000000..dc00db197
--- /dev/null
+++ b/app/workers/block_worker.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class BlockWorker
+  include Sidekiq::Worker
+
+  def perform(account_id, target_account_id)
+    BlockService.new.call(Account.find(account_id), Account.find(target_account_id))
+  end
+end
diff --git a/app/workers/merge_worker.rb b/app/workers/merge_worker.rb
new file mode 100644
index 000000000..0f288f43f
--- /dev/null
+++ b/app/workers/merge_worker.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class MergeWorker
+  include Sidekiq::Worker
+
+  def perform(from_account_id, into_account_id)
+    FeedManager.instance.merge_into_timeline(Account.find(from_account_id), Account.find(into_account_id))
+  end
+end
diff --git a/app/workers/unmerge_worker.rb b/app/workers/unmerge_worker.rb
new file mode 100644
index 000000000..dbf7243de
--- /dev/null
+++ b/app/workers/unmerge_worker.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class UnmergeWorker
+  include Sidekiq::Worker
+
+  def perform(from_account_id, into_account_id)
+    FeedManager.instance.unmerge_from_timeline(Account.find(from_account_id), Account.find(into_account_id))
+  end
+end