about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorTakeshi Umeda <noel.yoshiba@gmail.com>2022-10-23 01:30:55 +0900
committerGitHub <noreply@github.com>2022-10-22 18:30:55 +0200
commit74ead7d10698c7f18ca22c07d2f04ff81f419097 (patch)
tree3bc7504ab88d44bbc28c0bb1dfa40a85963d65dd /app/workers
parent73a48318a19a207c63f6d03ecea8ce35b7e2364a (diff)
Change featured tag updates to add/remove activity (#19409)
* Change featured tag updates to add/remove activity

* Fix to check for the existence of feature tag

* Rename service and worker

* Merge AddHashtagSerializer with AddSerializer

* Undo removal of sidekiq_options
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/activitypub/account_raw_distribution_worker.rb9
-rw-r--r--app/workers/remove_featured_tag_worker.rb11
2 files changed, 20 insertions, 0 deletions
diff --git a/app/workers/activitypub/account_raw_distribution_worker.rb b/app/workers/activitypub/account_raw_distribution_worker.rb
new file mode 100644
index 000000000..a84c7d214
--- /dev/null
+++ b/app/workers/activitypub/account_raw_distribution_worker.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class ActivityPub::AccountRawDistributionWorker < ActivityPub::RawDistributionWorker
+  protected
+
+  def inboxes
+    @inboxes ||= AccountReachFinder.new(@account).inboxes
+  end
+end
diff --git a/app/workers/remove_featured_tag_worker.rb b/app/workers/remove_featured_tag_worker.rb
new file mode 100644
index 000000000..065ec79d8
--- /dev/null
+++ b/app/workers/remove_featured_tag_worker.rb
@@ -0,0 +1,11 @@
+# frozen_string_literal: true
+
+class RemoveFeaturedTagWorker
+  include Sidekiq::Worker
+
+  def perform(account_id, featured_tag_id)
+    RemoveFeaturedTagService.new.call(Account.find(account_id), FeaturedTag.find(featured_tag_id))
+  rescue ActiveRecord::RecordNotFound
+    true
+  end
+end