mirror of
https://github.com/plausible/analytics.git
synced 2024-09-11 18:07:33 +03:00
Temporarily disable accept_traffic_until actions (#3730)
* Temporarily disable accept_traffic_until actions * Remove commented code
This commit is contained in:
parent
100e89370f
commit
58afe3376f
@ -527,7 +527,7 @@ base_queues = [
|
||||
google_analytics_imports: 1,
|
||||
analytics_imports: 1,
|
||||
domain_change_transition: 1,
|
||||
check_accept_traffic_until: 1
|
||||
check_accept_traffic_until: 0
|
||||
]
|
||||
|
||||
cloud_queues = [
|
||||
|
@ -43,17 +43,10 @@ defmodule Plausible.Site.GateKeeper do
|
||||
end
|
||||
|
||||
defp policy(domain, opts) when is_binary(domain) do
|
||||
with from_cache <- Cache.get(domain, Keyword.get(opts, :cache_opts, [])),
|
||||
site = %Site{owner: %{accept_traffic_until: accept_traffic_until}} <- from_cache do
|
||||
if not is_nil(accept_traffic_until) and
|
||||
Date.after?(Date.utc_today(), accept_traffic_until) do
|
||||
:payment_required
|
||||
else
|
||||
check_rate_limit(site, opts)
|
||||
end
|
||||
if site = Cache.get(domain, Keyword.get(opts, :cache_opts, [])) do
|
||||
check_rate_limit(site, opts)
|
||||
else
|
||||
_ ->
|
||||
@policy_for_non_existing_sites
|
||||
@policy_for_non_existing_sites
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -117,6 +117,7 @@ defmodule Plausible.Ingestion.EventTest do
|
||||
assert dropped.drop_reason == :dc_ip
|
||||
end
|
||||
|
||||
@tag :skip
|
||||
test "event pipeline drops events for site with accept_trafic_until in the past" do
|
||||
yesterday = Date.add(Date.utc_today(), -1)
|
||||
|
||||
|
@ -14,6 +14,7 @@ defmodule Plausible.Site.GateKeeperTest do
|
||||
assert {:deny, :not_found} = GateKeeper.check("example.com", opts)
|
||||
end
|
||||
|
||||
@tag :skip
|
||||
test "sites with accepted_traffic_until < now are denied", %{test: test, opts: opts} do
|
||||
domain = "expired.example.com"
|
||||
yesterday = Date.utc_today() |> Date.add(-1)
|
||||
|
Loading…
Reference in New Issue
Block a user