Skip to content

Commit f80405e

Browse files
committed
Use exported regex pattern for stored regex to avoid cache issues
1 parent 851c689 commit f80405e

3 files changed

Lines changed: 3 additions & 5 deletions

File tree

lib/plausible/ecto/types/compiled_regex.ex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ defmodule Plausible.Ecto.Types.CompiledRegex do
99
def cast(val) when is_binary(val), do: {:ok, val}
1010
def cast(_), do: :error
1111

12-
def load(val), do: {:ok, Regex.compile!(val)}
12+
def load(val), do: {:ok, Regex.compile!(val, "E")}
1313
def dump(val), do: {:ok, val}
1414
end

test/plausible/shield/hostname_rule_cache_test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,7 @@ defmodule Plausible.Shield.HostnameRuleCacheTest do
100100

101101
assert :ok = HostnameRuleCache.refresh_all(cache_opts)
102102

103-
# FIXME: probably broken :refresh_all in :bag cash
104-
# assert [_, _] = HostnameRuleCache.get(domain, cache_opts)
103+
assert [_, _] = HostnameRuleCache.get(domain, cache_opts)
105104
end
106105
end
107106

test/plausible/shield/page_rule_cache_test.exs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ defmodule Plausible.Shield.PageRuleCacheTest do
9797

9898
assert :ok = PageRuleCache.refresh_all(cache_opts)
9999

100-
# FIXME: probably broken :refresh_all in :bag cash
101-
# assert [_, _] = PageRuleCache.get(domain, cache_opts)
100+
assert [_, _] = PageRuleCache.get(domain, cache_opts)
102101
end
103102
end
104103

0 commit comments

Comments
 (0)