From e30ba8b27f869fcc4063e914da34ec5ae412ab98 Mon Sep 17 00:00:00 2001 From: Vini Brasil Date: Thu, 7 Sep 2023 11:37:21 -0300 Subject: [PATCH] Silence undefined plan Sentry log for trials (#3332) --- lib/plausible/billing/quota.ex | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/plausible/billing/quota.ex b/lib/plausible/billing/quota.ex index 94b5f080f..c19023d50 100644 --- a/lib/plausible/billing/quota.ex +++ b/lib/plausible/billing/quota.ex @@ -44,6 +44,7 @@ defmodule Plausible.Billing.Quota do end @monthly_pageview_limit_for_free_10k 10_000 + @monthly_pageview_limit_for_trials :unlimited @spec monthly_pageview_limit(Plausible.Billing.Subscription.t()) :: non_neg_integer() | :unlimited @@ -62,11 +63,13 @@ defmodule Plausible.Billing.Quota do @monthly_pageview_limit_for_free_10k _any -> - Sentry.capture_message("Unknown monthly pageview limit for plan", - extra: %{paddle_plan_id: subscription && subscription.paddle_plan_id} - ) + if subscription do + Sentry.capture_message("Unknown monthly pageview limit for plan", + extra: %{paddle_plan_id: subscription.paddle_plan_id} + ) + end - :unlimited + @monthly_pageview_limit_for_trials end end