Improve compilation dependency in endpoint and context

Signed-off-by: Thomas Citharel <tcit@tcit.fr>
This commit is contained in:
Thomas Citharel
2021-12-15 09:47:52 +01:00
parent b484629010
commit c174e18b39
2 changed files with 4 additions and 6 deletions

View File

@@ -2,10 +2,9 @@ defmodule Mobilizon.Web.Endpoint do
@moduledoc """
Endpoint for Mobilizon app
"""
alias Mobilizon.Service.ErrorReporting.Sentry, as: SentryAdapter
if Application.fetch_env!(:mobilizon, :env) !== :test &&
SentryAdapter.enabled?() do
Application.get_env(:sentry, :dsn) != nil do
use Sentry.PlugCapture
end
@@ -85,7 +84,7 @@ defmodule Mobilizon.Web.Endpoint do
end
if Application.fetch_env!(:mobilizon, :env) !== :test &&
SentryAdapter.enabled?() do
Application.get_env(:sentry, :dsn) != nil do
plug(Sentry.PlugContext)
end
end