about summary refs log tree commit diff
path: root/app/workers
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-11-24 12:27:15 -0600
committerFire Demon <firedemon@creature.cafe>2020-11-24 12:27:15 -0600
commit69fa4f7d4f3c435018c1e7cb9e6a0fcb5b233695 (patch)
treeffbd8bc1e5c820fce33624874088863c43460299 /app/workers
parent90b33ab8af91991217cdce3e2d9163756e58a691 (diff)
parent24696458bf22c8529b49f89b2791e3e07583b7e0 (diff)
Merge remote-tracking branch 'upstream/master' into merge-glitch
Diffstat (limited to 'app/workers')
-rw-r--r--app/workers/account_deletion_worker.rb3
-rw-r--r--app/workers/cache_buster_worker.rb18
2 files changed, 20 insertions, 1 deletions
diff --git a/app/workers/account_deletion_worker.rb b/app/workers/account_deletion_worker.rb
index 81c3b91ad..98b67419d 100644
--- a/app/workers/account_deletion_worker.rb
+++ b/app/workers/account_deletion_worker.rb
@@ -7,7 +7,8 @@ class AccountDeletionWorker
 
   def perform(account_id, options = {})
     reserve_username = options.with_indifferent_access.fetch(:reserve_username, true)
-    DeleteAccountService.new.call(Account.find(account_id), reserve_username: reserve_username, reserve_email: false)
+    skip_activitypub = options.with_indifferent_access.fetch(:skip_activitypub, false)
+    DeleteAccountService.new.call(Account.find(account_id), reserve_username: reserve_username, skip_activitypub: skip_activitypub, reserve_email: false)
   rescue ActiveRecord::RecordNotFound
     true
   end
diff --git a/app/workers/cache_buster_worker.rb b/app/workers/cache_buster_worker.rb
new file mode 100644
index 000000000..5ad0a44cb
--- /dev/null
+++ b/app/workers/cache_buster_worker.rb
@@ -0,0 +1,18 @@
+# frozen_string_literal: true
+
+class CacheBusterWorker
+  include Sidekiq::Worker
+  include RoutingHelper
+
+  sidekiq_options queue: 'pull'
+
+  def perform(path)
+    cache_buster.bust(full_asset_url(path))
+  end
+
+  private
+
+  def cache_buster
+    CacheBuster.new(Rails.configuration.x.cache_buster)
+  end
+end