mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-22 15:46:21 +00:00
parent
882ab1679c
commit
56c583e0f4
2 changed files with 7 additions and 3 deletions
|
@ -125,8 +125,9 @@ module Api
|
|||
o.save!
|
||||
|
||||
# XXX: el objeto necesita ser guardado antes de poder
|
||||
# procesarlo
|
||||
::ActivityPub::FetchJob.perform_later(site: site, object: o) unless object_embedded?
|
||||
# procesarlo. No usamos GlobalID porque el tipo de objeto
|
||||
# cambia y produce un error de deserialización.
|
||||
::ActivityPub::FetchJob.perform_later(site: site, object_id: o.id) unless object_embedded?
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
@ -11,8 +11,11 @@ class ActivityPub
|
|||
class FetchJob < ApplicationJob
|
||||
self.priority = 50
|
||||
|
||||
def perform(site:, object:)
|
||||
def perform(site:, object_id:)
|
||||
ActivityPub::Object.transaction do
|
||||
object = ::ActivityPub::Object.find(object_id)
|
||||
|
||||
return if object.blank?
|
||||
return if object.activity_pubs.where(aasm_state: 'removed').count.positive?
|
||||
|
||||
response = site.social_inbox.dereferencer.get(uri: object.uri)
|
||||
|
|
Loading…
Reference in a new issue