about summary refs log tree commit diff
path: root/lib
diff options
context:
space:
mode:
authorFire Demon <firedemon@creature.cafe>2020-09-19 17:41:06 -0500
committerFire Demon <firedemon@creature.cafe>2020-09-19 17:41:27 -0500
commitb31328ebd532f2af5d559bfc53f12d15ab266631 (patch)
treed61a45a89dd60dc94ffdc217cb7a38128f802648 /lib
parent38af65e794722120bc59eda343059152646a32d0 (diff)
[Federation] Add monsterfork:refresh_application_actors task to redownload all application actors
Diffstat (limited to 'lib')
-rw-r--r--lib/tasks/monsterfork.rake10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/tasks/monsterfork.rake b/lib/tasks/monsterfork.rake
index b87f681fd..63ce3cd4e 100644
--- a/lib/tasks/monsterfork.rake
+++ b/lib/tasks/monsterfork.rake
@@ -26,4 +26,14 @@ namespace :monsterfork do
     ActivityPub::UpdateDistributionWorker.new.perform(Account.representative.id)
     Rails.logger.info('Done!')
   end
+
+  desc 'Update the accounts of allow-listed application and instance actors'
+  task refresh_application_actors: :environment  do
+    Account.remote.without_suspended.where(actor_type: 'Application').find_each do |account|
+      Rails.logger.info("Refetching application actor: #{account.acct}")
+      account.update!(last_webfingered_at: nil)
+      ResolveAccountService.new.call(account)
+    end
+    Rails.logger.info('Done!')
+  end
 end