From 2913da269203a02e5d049708311a6e92baee49c6 Mon Sep 17 00:00:00 2001 From: "byte[]" Date: Sun, 6 Sep 2020 12:39:53 -0400 Subject: [PATCH] remove Repo.isolated_transaction/2 --- lib/philomena/repo.ex | 20 -------------------- 1 file changed, 20 deletions(-) diff --git a/lib/philomena/repo.ex b/lib/philomena/repo.ex index ea3f05be..cd5da3a5 100644 --- a/lib/philomena/repo.ex +++ b/lib/philomena/repo.ex @@ -1,27 +1,7 @@ defmodule Philomena.Repo do - alias Ecto.Multi - use Ecto.Repo, otp_app: :philomena, adapter: Ecto.Adapters.Postgres use Scrivener, page_size: 250 - - @levels %{ - read_committed: "READ COMMITTED", - repeatable_read: "REPEATABLE READ", - serializable: "SERIALIZABLE" - } - - def isolated_transaction(%Multi{} = multi, level) do - Multi.append( - Multi.new() - |> Multi.run(:isolate, fn repo, _chg -> - repo.query!("SET TRANSACTION ISOLATION LEVEL #{@levels[level]}") - {:ok, nil} - end), - multi - ) - |> Philomena.Repo.transaction() - end end