Skip to content

Commit

Permalink
Used more specific lock
Browse files Browse the repository at this point in the history
Rather than piggyback on the build lock when getting project mix
config, use a different lock type.
  • Loading branch information
scohen committed Sep 5, 2024
1 parent bd43352 commit dd4bd18
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions apps/remote_control/lib/lexical/remote_control/mix.ex
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
defmodule Lexical.RemoteControl.Mix do
alias Lexical.Project
alias Lexical.RemoteControl
alias Lexical.RemoteControl.Build

def in_project(fun) do
if RemoteControl.project_node?() do
Expand All @@ -17,7 +16,7 @@ defmodule Lexical.RemoteControl.Mix do

old_cwd = File.cwd!()

Build.with_lock(fn ->
with_lock(fn ->
try do
Mix.ProjectStack.post_config(prune_code_paths: false)

Expand Down Expand Up @@ -48,4 +47,8 @@ defmodule Lexical.RemoteControl.Mix do
end
end)
end

defp with_lock(fun) do
RemoteControl.with_lock(__MODULE__, fun)
end
end

0 comments on commit dd4bd18

Please sign in to comment.