diff options
author | Mark Felder <feld@feld.me> | 2021-04-20 11:16:24 -0500 |
---|---|---|
committer | Mark Felder <feld@feld.me> | 2021-04-22 10:15:50 -0500 |
commit | 9f711ddcf84bdb5a5680e1b55afa83768014906d (patch) | |
tree | 92ce6a2b0c1b6a5aad449188e25a767d81ca3d85 | |
parent | 9bc69196d5dfbd3fb37c0e62da19ce08fb9bf28d (diff) | |
download | pleroma-9f711ddcf84bdb5a5680e1b55afa83768014906d.tar.gz |
Try to set query timeout intelligently
-rw-r--r-- | lib/pleroma/web/activity_pub/pipeline.ex | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pleroma/web/activity_pub/pipeline.ex b/lib/pleroma/web/activity_pub/pipeline.ex index 400823094..a0f2e0312 100644 --- a/lib/pleroma/web/activity_pub/pipeline.ex +++ b/lib/pleroma/web/activity_pub/pipeline.ex @@ -7,6 +7,7 @@ defmodule Pleroma.Web.ActivityPub.Pipeline do alias Pleroma.Config alias Pleroma.Object alias Pleroma.Repo + alias Pleroma.Utils alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.MRF alias Pleroma.Web.ActivityPub.ObjectValidator @@ -24,7 +25,7 @@ defmodule Pleroma.Web.ActivityPub.Pipeline do @spec common_pipeline(map(), keyword()) :: {:ok, Activity.t() | Object.t(), keyword()} | {:error, any()} def common_pipeline(object, meta) do - case Repo.transaction(fn -> do_common_pipeline(object, meta) end, timeout: :infinity) do + case Repo.transaction(fn -> do_common_pipeline(object, meta) end, Utils.query_timeout()) do {:ok, {:ok, activity, meta}} -> @side_effects.handle_after_transaction(meta) {:ok, activity, meta} |