5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-22 15:16:21 +00:00

fix: usar locks en moderaciones de instancia

closes #15788
This commit is contained in:
f 2024-03-22 17:31:53 -03:00
parent dbf15397e5
commit 07fd2cff93
No known key found for this signature in database

View file

@ -9,7 +9,7 @@ class ActivityPub
def perform(site:, hostnames:, perform_remotely: true)
# Crear las instancias que no existan todavía
hostnames.each do |hostname|
ActivityPub::Instance.find_or_create_by(hostname: hostname)
ActivityPub::Instance.lock.find_or_create_by(hostname: hostname)
end
instances = ActivityPub::Instance.where(hostname: hostnames)
@ -20,7 +20,7 @@ class ActivityPub
instances.find_each do |instance|
# Esto bloquea cada una individualmente en la Social Inbox,
# idealmente son pocas instancias las que aparecen.
site.instance_moderations.find_or_create_by(instance: instance)
site.instance_moderations.lock.find_or_create_by(instance: instance)
end
scope = site.instance_moderations.where(instance_id: instances.ids)