mirror of
https://0xacab.org/sutty/sutty
synced 2024-11-24 16:56:21 +00:00
fix: prevenir deadlocks
closes #15555 closes #15556 closes #15557 closes #15558 closes #15559 closes #15560
This commit is contained in:
parent
79e6ce7872
commit
97653d98b6
1 changed files with 14 additions and 12 deletions
|
@ -13,22 +13,24 @@ class ActivityPub
|
|||
# lo haría la Social Inbox por nosotres.
|
||||
# @see {https://docs.joinmastodon.org/spec/security/#ld}
|
||||
def update_activity_pub_state!
|
||||
ActivityPub.transaction do
|
||||
object = ActivityPub::Object.find_by(uri: ActivityPub.uri_from_object(content['object']))
|
||||
ActiveRecord::Base.connection_pool.with_connection do
|
||||
ActivityPub.transaction do
|
||||
object = ActivityPub::Object.find_by(uri: ActivityPub.uri_from_object(content['object']))
|
||||
|
||||
if object.present?
|
||||
object.activity_pubs.find_each do |activity_pub|
|
||||
activity_pub.remove! if activity_pub.may_remove?
|
||||
if object.present?
|
||||
object.activity_pubs.find_each do |activity_pub|
|
||||
activity_pub.remove! if activity_pub.may_remove?
|
||||
end
|
||||
|
||||
# Encontrar todas las acciones de moderación de le actore
|
||||
# eliminade y moverlas a eliminar.
|
||||
if object.actor_type? && object.actor.present?
|
||||
ActorModeration.where(actor_id: object.actor.id).remove_all!
|
||||
end
|
||||
end
|
||||
|
||||
# Encontrar todas las acciones de moderación de le actore
|
||||
# eliminade y moverlas a eliminar.
|
||||
if object.actor_type? && object.actor.present?
|
||||
ActorModeration.where(actor_id: object.actor.id).remove_all!
|
||||
end
|
||||
activity_pub.remove! if activity_pub.may_remove?
|
||||
end
|
||||
|
||||
activity_pub.remove! if activity_pub.may_remove?
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue