logo

pleroma

My custom branche(s) on git.pleroma.social/pleroma/pleroma git clone https://hacktivis.me/git/pleroma.git
commit: d9b82255b9cf49176f8ef1d5a87abf7d80769a47
parent 03f4b461895802259c895c81462a3e9d0d31c1e5
Author: Mark Felder <feld@feld.me>
Date:   Sun, 26 May 2024 15:23:12 -0400

Add an HTTP timeout for the healthcheck

Diffstat:

Mlib/pleroma/search/healthcheck.ex5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/pleroma/search/healthcheck.ex b/lib/pleroma/search/healthcheck.ex @@ -8,8 +8,9 @@ defmodule Pleroma.Search.Healthcheck do use GenServer require Logger - @tick :timer.seconds(5) @queue :search_indexing + @tick :timer.seconds(5) + @timeout :timer.seconds(2) def start_link(_) do GenServer.start_link(__MODULE__, [], name: __MODULE__) @@ -59,7 +60,7 @@ defmodule Pleroma.Search.Healthcheck do Enum.all?( urls, fn url -> - case Pleroma.HTTP.get(url) do + case Pleroma.HTTP.get(url, [], recv_timeout: @timeout) do {:ok, %{status: 200}} -> true _ -> false end