You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
analytics/lib/plausible_web/controllers/api/internal_controller.ex

14 lines
346 B
Elixir

7 years ago
defmodule PlausibleWeb.Api.InternalController do
use PlausibleWeb, :controller
use Plausible.Repo
alias Plausible.Stats.Clickhouse, as: Stats
7 years ago
def domain_status(conn, %{"domain" => domain}) do
if Stats.has_pageviews?(%Plausible.Site{domain: domain}) do
7 years ago
json(conn, "READY")
else
json(conn, "WAITING")
end
end
end