feature/elasticsearch #1

Merged
floatingghost merged 41 commits from feature/elasticsearch into develop 2021-12-12 17:37:28 +00:00
2 changed files with 9 additions and 3 deletions
Showing only changes of commit c4d2717beb - Show all commits

View file

@ -27,7 +27,8 @@ defp config, do: Config.get([:pipeline, :config], Config)
def common_pipeline(object, meta) do
case Repo.transaction(fn -> do_common_pipeline(object, meta) end, Utils.query_timeout()) do
{: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, value} ->

View file

@ -537,11 +537,16 @@ defp add_notifications(meta, notifications) do
end
@impl true
def handle_after_transaction(activity, meta) do
Pleroma.Elasticsearch.put_by_id(activity.id)
@impl true
def handle_after_transaction(%{data: %{"type" => "Create"}} = activity) do
Elasticsearch.put_by_id(activity.id)
end
def handle_after_transaction(meta) do
meta
|> send_notifications()
|> send_streamables()
end
def handle_after_transaction(_), do: :ok
end