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