From 9521cf751aa2ad61f85447f3f8a90861b7da1357 Mon Sep 17 00:00:00 2001 From: Steve Cohen Date: Wed, 4 Sep 2024 10:40:46 -0700 Subject: [PATCH] Used more specific lock Rather than piggyback on the build lock when getting project mix config, use a different lock type. --- apps/remote_control/lib/lexical/remote_control/mix.ex | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/remote_control/lib/lexical/remote_control/mix.ex b/apps/remote_control/lib/lexical/remote_control/mix.ex index 6def5e539..63b4a042f 100644 --- a/apps/remote_control/lib/lexical/remote_control/mix.ex +++ b/apps/remote_control/lib/lexical/remote_control/mix.ex @@ -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 @@ -11,13 +10,17 @@ defmodule Lexical.RemoteControl.Mix do end end + def with_lock(fun) do + RemoteControl.with_lock(__MODULE__, fun) + end + def in_project(%Project{} = project, fun) do # Locking on the build make sure we don't get a conflict on the mix.exs being # already defined old_cwd = File.cwd!() - Build.with_lock(fn -> + with_lock(fn -> try do Mix.ProjectStack.post_config(prune_code_paths: false)