5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2025-03-15 03:48:16 +00:00

Merge branch 'issue-15109-1' of https://0xacab.org/sutty/sutty into production.panel.sutty.nl

This commit is contained in:
Sutty 2024-03-13 19:12:33 +00:00
commit 60a7f7109d
2 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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)