Skip to content

Commit

Permalink
fixup! [JET-2026] feature: use dynamic repo to execute action (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
vanppo committed Oct 23, 2024
1 parent c681149 commit b6be7fa
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/resource_kit/repo.ex
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@ defmodule ResourceKit.Repo do
@spec execute(dynamic_repo :: dynamic_repo(), callback :: (Ecto.Repo.t() -> result)) :: result
when result: var
def execute(dynamic_repo, callback) do
default = @adapter.get_dynamic_repo()
default = adapter().get_dynamic_repo()

try do
@adapter.put_dynamic_repo(dynamic_repo)
adapter().put_dynamic_repo(dynamic_repo)
callback.(@adapter)
after
@adapter.put_dynamic_repo(default)
adapter().put_dynamic_repo(default)
end
end
end

0 comments on commit b6be7fa

Please sign in to comment.