aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRoger Braun <roger@rogerbraun.net>2017-05-01 16:15:21 +0200
committerRoger Braun <roger@rogerbraun.net>2017-05-01 16:15:21 +0200
commit3cb518270ab8c41f73ed449f0c12127c3625c6ca (patch)
tree1c3187ead459fad588864c8c6bf18d01f6238d21 /lib
parentf169de34544a12c174c454da59781a694b8c2387 (diff)
downloadpleroma-3cb518270ab8c41f73ed449f0c12127c3625c6ca.tar.gz
Remove superfluous transaction.
Diffstat (limited to 'lib')
-rw-r--r--lib/pleroma/web/twitter_api/twitter_api.ex17
1 files changed, 7 insertions, 10 deletions
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