Merge branch 'develop' into audit-mix-audit-report
This commit is contained in:
commit
72d45a9f8b
12 changed files with 42 additions and 16 deletions
|
|
@ -258,10 +258,16 @@ defmodule Pleroma.FollowingRelationship do
|
|||
[_, user_actor: user_actor],
|
||||
fragment(
|
||||
# "(actor's domain NOT in domain_blocks) OR (actor IS in followed AP IDs)"
|
||||
#
|
||||
# ARRAY(SELECT ...) makes the followed-ids lookup an InitPlan that is
|
||||
# evaluated and costed once. As a plain subselect, the planner charges
|
||||
# its startup cost on every rescan of the actor lookup, which inflates
|
||||
# the cost of the index plan enough for it to lose to a plan that
|
||||
# materialises every active user for every candidate row.
|
||||
"""
|
||||
NOT (substring(? from '.*://([^/]*)') = ANY(?)) OR
|
||||
? = ANY(SELECT ap_id FROM users AS u INNER JOIN following_relationships AS fr
|
||||
ON u.id = fr.following_id WHERE fr.follower_id = ? AND fr.state = ?)
|
||||
? = ANY(ARRAY(SELECT ap_id FROM users AS u INNER JOIN following_relationships AS fr
|
||||
ON u.id = fr.following_id WHERE fr.follower_id = ? AND fr.state = ?))
|
||||
""",
|
||||
user_actor.ap_id,
|
||||
^user.domain_blocks,
|
||||
|
|
|
|||
|
|
@ -33,7 +33,7 @@ defmodule Pleroma.Web.Plugs.IdempotencyPlug do
|
|||
|
||||
case @cachex.get(:idempotency_cache, cache_key) do
|
||||
{:ok, nil} ->
|
||||
cache_resposnse(conn, key, cache_key)
|
||||
cache_response(conn, key, cache_key)
|
||||
|
||||
{:ok, record} ->
|
||||
send_cached(conn, key, record)
|
||||
|
|
@ -43,7 +43,7 @@ defmodule Pleroma.Web.Plugs.IdempotencyPlug do
|
|||
end
|
||||
end
|
||||
|
||||
defp cache_resposnse(conn, key, cache_key) do
|
||||
defp cache_response(conn, key, cache_key) do
|
||||
register_before_send(conn, &maybe_cache_response(&1, key, cache_key))
|
||||
end
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue