mirror of
https://akkoma.dev/AkkomaGang/akkoma.git
synced 2024-11-17 12:36:11 +00:00
Remove superfluous transaction.
This commit is contained in:
parent
f169de3454
commit
3cb518270a
|
@ -316,16 +316,13 @@ defmodule Pleroma.Web.TwitterAPI.TwitterAPI do
|
||||||
end
|
end
|
||||||
|
|
||||||
def context_to_conversation_id(context) do
|
def context_to_conversation_id(context) do
|
||||||
{:ok, id} = Repo.transaction(fn ->
|
with %Object{id: id} <- Object.get_cached_by_ap_id(context) do
|
||||||
with %Object{id: id} <- Object.get_cached_by_ap_id(context) do
|
id
|
||||||
id
|
else _e ->
|
||||||
else _e ->
|
changeset = Object.context_mapping(context)
|
||||||
changeset = Object.context_mapping(context)
|
{:ok, %{id: id}} = Repo.insert(changeset)
|
||||||
{:ok, %{id: id}} = Repo.insert(changeset)
|
id
|
||||||
id
|
end
|
||||||
end
|
|
||||||
end)
|
|
||||||
id
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def conversation_id_to_context(id) do
|
def conversation_id_to_context(id) do
|
||||||
|
|
Loading…
Reference in a new issue