From 10fd2a0968e689e73b21d544f7e2bb8840010fa8 Mon Sep 17 00:00:00 2001 From: Eric Hunkler Date: Mon, 25 Aug 2025 15:33:32 -0600 Subject: [PATCH] Remove pattern match on calling exec.stop/1 There is no need to pattern match on this function call. We check to confirm that the process was stopped correctly in the next line. With the current pattern match, we cause an error when the PID is already stopped. --- lib/vector/agent.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vector/agent.ex b/lib/vector/agent.ex index 13d3ac2..f439521 100644 --- a/lib/vector/agent.ex +++ b/lib/vector/agent.ex @@ -89,7 +89,7 @@ defmodule Vector.Agent do def terminate(message, agent) when message in [:normal, :shutdown] do :ok = Logger.log(agent, :info, "vector: Vector is stopping.") - :ok = :exec.stop(agent.os_pid) + :exec.stop(agent.os_pid) do_confirm_exit(agent) do_flush_messages(agent) :ok = Logger.log(agent, :info, "vector: Vector has stopped.")