Remove superfluous transaction.
authorRoger Braun <roger@rogerbraun.net>
Mon, 1 May 2017 14:15:21 +0000 (16:15 +0200)
committerRoger Braun <roger@rogerbraun.net>
Mon, 1 May 2017 14:15:21 +0000 (16:15 +0200)
lib/pleroma/web/twitter_api/twitter_api.ex

index 941bacaa94e713076ef6c88c9f8d25a98659224a..e6f5fc90645807c61cc9a2b903a167ebb6120c5e 100644 (file)
@@ -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