From: Roger Braun Date: Mon, 1 May 2017 14:15:21 +0000 (+0200) Subject: Remove superfluous transaction. X-Git-Url: https://git.squeep.com/?a=commitdiff_plain;h=3cb518270ab8c41f73ed449f0c12127c3625c6ca;p=akkoma Remove superfluous transaction. --- diff --git a/lib/pleroma/web/twitter_api/twitter_api.ex b/lib/pleroma/web/twitter_api/twitter_api.ex index 941bacaa9..e6f5fc906 100644 --- a/lib/pleroma/web/twitter_api/twitter_api.ex +++ b/lib/pleroma/web/twitter_api/twitter_api.ex @@ -316,16 +316,13 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do end def context_to_conversation_id(context) do - {:ok, id} = Repo.transaction(fn -> - with %Object{id: id} <- Object.get_cached_by_ap_id(context) do - id - else _e -> - changeset = Object.context_mapping(context) - {:ok, %{id: id}} = Repo.insert(changeset) - id - end - end) - id + with %Object{id: id} <- Object.get_cached_by_ap_id(context) do + id + else _e -> + changeset = Object.context_mapping(context) + {:ok, %{id: id}} = Repo.insert(changeset) + id + end end def conversation_id_to_context(id) do