fix: don't list telemetry handlers if app is compiling

This commit is contained in:
Zach Daniel 2024-08-26 10:01:39 -04:00
parent dbe825b504
commit 04382cbc53

View file

@ -85,17 +85,19 @@ defmodule Ash.Tracer do
metadata = unquote(metadata)
compiling? = Code.can_await_module_compilation?()
metadata =
case :telemetry.list_handlers(telemetry_name) do
[] -> %{}
_ when is_function(metadata) -> apply(metadata, [])
_ -> metadata
unless compiling? do
case :telemetry.list_handlers(telemetry_name) do
[] -> %{}
_ when is_function(metadata) -> apply(metadata, [])
_ -> metadata
end
end
start = System.monotonic_time()
compiling? = Code.can_await_module_compilation?()
unless compiling? do
:telemetry.execute(
telemetry_name ++ [:start],