diff options
author | Fire Demon <firedemon@creature.cafe> | 2020-09-01 19:39:52 -0500 |
---|---|---|
committer | Fire Demon <firedemon@creature.cafe> | 2020-09-01 19:59:18 -0500 |
commit | 0e3cc6ba7551effd5396699553fa954aa816b1e8 (patch) | |
tree | 514aeb8d87e347b9a851cc08cac0fab3f18d656a /app/workers | |
parent | ff791b8e8b9ce08679105dca9114f04af72338d3 (diff) |
[Privacy] Purge and re-download remote accounts if their actor key suddenly changes monsterfork-2020-09-01
Diffstat (limited to 'app/workers')
-rw-r--r-- | app/workers/reset_account_worker.rb | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/app/workers/reset_account_worker.rb b/app/workers/reset_account_worker.rb new file mode 100644 index 000000000..f63d8682a --- /dev/null +++ b/app/workers/reset_account_worker.rb @@ -0,0 +1,16 @@ +# frozen_string_literal: true + +class ResetAccountWorker + include Sidekiq::Worker + + def perform(account_id) + account = Account.find(account_id) + return if account.local? + + account_uri = account.uri + SuspendAccountService.new.call(account) + ResolveAccountService.new.call(account_uri) + rescue ActiveRecord::RecordNotFound + true + end +end |