From 4058a4384ed834cc916602433363583d0a23f1ce Mon Sep 17 00:00:00 2001 From: Andrew Berrien <74077809+APB9785@users.noreply.github.com> Date: Wed, 20 Nov 2024 11:30:44 -0600 Subject: [PATCH] use env to adjust safe_load timeout (#661) --- lib/beacon/loader/worker.ex | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/beacon/loader/worker.ex b/lib/beacon/loader/worker.ex index c0daa865..3acb12c9 100644 --- a/lib/beacon/loader/worker.ex +++ b/lib/beacon/loader/worker.ex @@ -582,11 +582,12 @@ defmodule Beacon.Loader.Worker do {:error, {:already_registered, pid}} -> # another worker already started, let's wait for it _ref = Process.monitor(pid) + time_to_wait = if(Beacon.Config.env_test?(), do: 500, else: 15_000) receive do {:DOWN, _ref, :process, _pid, {:shutdown, :loaded}} -> module after - 1_000 -> :error + time_to_wait -> :error end end end