Try fix
This commit is contained in:
@@ -253,10 +253,18 @@ defmodule Systant.CommandExecutor do
|
||||
env = build_command_environment()
|
||||
|
||||
Logger.info("Executing system command: #{inspect(final_command)} (timeout: #{timeout}ms)")
|
||||
Logger.debug("Environment PATH: #{Map.get(env, "PATH")}")
|
||||
Logger.debug("Environment USER: #{Map.get(env, "USER")}")
|
||||
Logger.debug("Environment HOME: #{Map.get(env, "HOME")}")
|
||||
Logger.debug("Environment XDG_RUNTIME_DIR: #{Map.get(env, "XDG_RUNTIME_DIR")}")
|
||||
|
||||
try do
|
||||
case System.cmd(List.first(final_command), Enum.drop(final_command, 1),
|
||||
stderr_to_stdout: true, timeout: timeout, env: env) do
|
||||
task = Task.async(fn ->
|
||||
System.cmd(List.first(final_command), Enum.drop(final_command, 1),
|
||||
stderr_to_stdout: true, env: env)
|
||||
end)
|
||||
|
||||
case Task.await(task, timeout) do
|
||||
{output, 0} ->
|
||||
execution_time = System.monotonic_time(:millisecond) - start_time
|
||||
Logger.info("Command completed successfully in #{execution_time}ms")
|
||||
|
||||
Reference in New Issue
Block a user