mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-14 21:24:41 +00:00
pipeline it
This commit is contained in:
parent
ef9dea66b2
commit
dbdf0c005e
2 changed files with 9 additions and 3 deletions
|
@ -27,7 +27,8 @@ defmodule Pleroma.Web.ActivityPub.Pipeline do
|
||||||
def common_pipeline(object, meta) do
|
def common_pipeline(object, meta) do
|
||||||
case Repo.transaction(fn -> do_common_pipeline(object, meta) end, Utils.query_timeout()) do
|
case Repo.transaction(fn -> do_common_pipeline(object, meta) end, Utils.query_timeout()) do
|
||||||
{:ok, {:ok, activity, meta}} ->
|
{:ok, {:ok, activity, meta}} ->
|
||||||
side_effects().handle_after_transaction(activity, meta)
|
side_effects().handle_after_transaction(meta)
|
||||||
|
side_effects().handle_after_transaction(activity)
|
||||||
{:ok, activity, meta}
|
{:ok, activity, meta}
|
||||||
|
|
||||||
{:ok, value} ->
|
{:ok, value} ->
|
||||||
|
|
|
@ -537,11 +537,16 @@ defmodule Pleroma.Web.ActivityPub.SideEffects do
|
||||||
end
|
end
|
||||||
|
|
||||||
@impl true
|
@impl true
|
||||||
def handle_after_transaction(activity, meta) do
|
@impl true
|
||||||
Pleroma.Elasticsearch.put_by_id(activity.id)
|
def handle_after_transaction(%{data: %{"type" => "Create"}} = activity) do
|
||||||
|
Elasticsearch.put_by_id(activity.id)
|
||||||
|
end
|
||||||
|
|
||||||
|
def handle_after_transaction(meta) do
|
||||||
meta
|
meta
|
||||||
|> send_notifications()
|
|> send_notifications()
|
||||||
|> send_streamables()
|
|> send_streamables()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def handle_after_transaction(_), do: :ok
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue