mirror of
https://github.com/plausible/analytics.git
synced 2024-11-23 20:13:31 +03:00
Simplify geolix database config
This commit is contained in:
parent
2ca3baeafd
commit
950bd012d5
@ -386,7 +386,8 @@ if config_env() != :test && geolite2_country_db do
|
||||
%{
|
||||
id: :country,
|
||||
adapter: Geolix.Adapter.MMDB2,
|
||||
source: geolite2_country_db
|
||||
source: geolite2_country_db,
|
||||
result_as: :raw
|
||||
}
|
||||
]
|
||||
end
|
||||
|
@ -194,9 +194,7 @@ defmodule PlausibleWeb.Api.ExternalController do
|
||||
PlausibleWeb.RemoteIp.get(conn)
|
||||
|> Geolix.lookup()
|
||||
|
||||
if result && result[:country] && result[:country].country do
|
||||
result[:country].country.iso_code
|
||||
end
|
||||
get_in(result, [:country, :country, :iso_code])
|
||||
end
|
||||
|
||||
defp parse_referrer(_, nil), do: nil
|
||||
|
Loading…
Reference in New Issue
Block a user