浏览代码

Remove superfluous transaction.

tags/v0.9.9
Roger Braun 7 年前
父节点
当前提交
3cb518270a
共有 1 个文件被更改,包括 7 次插入10 次删除
  1. +7
    -10
      lib/pleroma/web/twitter_api/twitter_api.ex

+ 7
- 10
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


正在加载...
取消
保存