diff options
author | lain <lain@soykaf.club> | 2020-06-05 16:47:02 +0200 |
---|---|---|
committer | lain <lain@soykaf.club> | 2020-06-05 16:47:02 +0200 |
commit | 115d08a7542b92c5e1d889da41c0ee6837a1235e (patch) | |
tree | 9f1d3aa8a65f53d5a42b9ab64013c2d9a3296a19 /lib/pleroma/web/activity_pub/pipeline.ex | |
parent | 65689ba9bd44e291fc626cce2bd5136b93a5da90 (diff) | |
download | pleroma-115d08a7542b92c5e1d889da41c0ee6837a1235e.tar.gz |
Pipeline: Add a side effects step after the transaction finishes
This is to run things like streaming notifications out, which will
sometimes need data that is created by the transaction, but is
streamed out asynchronously.
Diffstat (limited to 'lib/pleroma/web/activity_pub/pipeline.ex')
-rw-r--r-- | lib/pleroma/web/activity_pub/pipeline.ex | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/pleroma/web/activity_pub/pipeline.ex b/lib/pleroma/web/activity_pub/pipeline.ex index 0c54c4b23..6875c47f6 100644 --- a/lib/pleroma/web/activity_pub/pipeline.ex +++ b/lib/pleroma/web/activity_pub/pipeline.ex @@ -17,6 +17,10 @@ defmodule Pleroma.Web.ActivityPub.Pipeline do {:ok, Activity.t() | Object.t(), keyword()} | {:error, any()} def common_pipeline(object, meta) do case Repo.transaction(fn -> do_common_pipeline(object, meta) end) do + {:ok, {:ok, activity, meta}} -> + SideEffects.handle_after_transaction(meta) + {:ok, activity, meta} + {:ok, value} -> value |