diff options
author | Thibaut Girka <thib@sitedethib.com> | 2020-11-20 13:27:48 +0100 |
---|---|---|
committer | Thibaut Girka <thib@sitedethib.com> | 2020-11-20 13:27:48 +0100 |
commit | 48f0f3ffeeb2b3dfb8af7d4d0fba3b64697d125c (patch) | |
tree | 665a41c2543505b75b24b41761bc5d0ff9e9b458 /app/workers | |
parent | db01f8b942b72eaa2eacbb144261b002f8079c9c (diff) | |
parent | 8b8004a9626442ae31e4dffd79e874e9cde050c6 (diff) |
Merge branch 'master' into glitch-soc/merge-upstream
Conflicts: - `.github/ISSUE_TEMPLATE/bug_report.md`: Upstream added the `bug` label to bug reports. Did the same. - `app/services/fan_out_on_write_service.rb`: Upstream put DMs back into timelines, glitch-soc was already doing it. Ignored upstream changes.
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/account_deletion_worker.rb | 3 | ||||
-rw-r--r-- | app/workers/cache_buster_worker.rb | 18 |
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 |