From 9899dfd936dac382d460bd1af8c470816378b6e5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thibaut=20Barr=C3=A8re?= Date: Tue, 24 Dec 2024 14:16:21 +0100 Subject: [PATCH] Make sure to return a conn (avoid RuntimeError) --- apps/transport/lib/transport_web/plugs/worker_healthcheck.ex | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex b/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex index 3e36493d22..90e6e30c9c 100644 --- a/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex +++ b/apps/transport/lib/transport_web/plugs/worker_healthcheck.ex @@ -26,7 +26,7 @@ defmodule TransportWeb.Plugs.WorkerHealthcheck do store_last_attempted_at_delay_metric() status_code = if healthy_state?(), do: 200, else: 503 - conn + conn = conn |> put_resp_content_type("text/plain") |> send_resp(status_code, """ UP (WORKER-ONLY) @@ -45,6 +45,8 @@ defmodule TransportWeb.Plugs.WorkerHealthcheck do # "Asynchronously and carefully stops the Erlang runtime system." System.stop() end + + conn else conn end