From 37f3c76e521b8a07eb0312b2d7813436c38945db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Knuchel?= Date: Thu, 10 Oct 2024 16:55:53 +0200 Subject: [PATCH] Use Sentry plug only when configured --- backend/lib/azimutt_web/endpoint.ex | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/backend/lib/azimutt_web/endpoint.ex b/backend/lib/azimutt_web/endpoint.ex index 6605da681..958096655 100644 --- a/backend/lib/azimutt_web/endpoint.ex +++ b/backend/lib/azimutt_web/endpoint.ex @@ -1,5 +1,5 @@ defmodule AzimuttWeb.Endpoint do - use Sentry.PlugCapture + if System.get_env("SENTRY") == "true", do: use(Sentry.PlugCapture) use Phoenix.Endpoint, otp_app: :azimutt # The session will be stored in the cookie and signed, @@ -59,11 +59,9 @@ defmodule AzimuttWeb.Endpoint do pass: ["*/*"], json_decoder: Phoenix.json_library() - plug Sentry.PlugContext - + if System.get_env("SENTRY") == "true", do: plug(Sentry.PlugContext) plug Plug.MethodOverride plug Plug.Head plug Plug.Session, @session_options plug AzimuttWeb.Router - use Sentry.PlugCapture end