Class: ActivityPub::DistributionJob
- Inherits:
-
ApplicationJob
- Object
- ActiveJob::Base
- ApplicationJob
- ActivityPub::DistributionJob
- Defined in:
- app/jobs/activitypub/distribution_job.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.call(resource) ⇒ Object
4 5 6 |
# File 'app/jobs/activitypub/distribution_job.rb', line 4 def self.call(resource) ActivityPub::DistributionJob.perform_later(resource.class.name, resource.id) end |
Instance Method Details
#perform(resource_type, resource_id) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'app/jobs/activitypub/distribution_job.rb', line 8 def perform(resource_type, resource_id) @resource = resource_type.constantize.find(resource_id) @account = @resource.account inboxes.each do |inbox_url| ActivityPub::DeliveryJob.perform_later( signed_payload, @account.id, inbox_url ) end rescue ActiveRecord::RecordNotFound true end |