Skip to content

Commit

Permalink
Add dns clustering and upgrade deps
Browse files Browse the repository at this point in the history
  • Loading branch information
davidvanleeuwen authored and wietsehage committed Nov 8, 2023
1 parent 3137183 commit 674776b
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 58 deletions.
37 changes: 15 additions & 22 deletions assets/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions config/runtime.exs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ if config_env() == :prod do

maybe_ipv6 = if System.get_env("ECTO_IPV6"), do: [:inet6], else: []

config :mave_metrics, dns_cluster_query: System.get_env("DNS_CLUSTER_QUERY")

config :mave_metrics, MaveMetrics.Repo,
# ssl: true,
url: database_url,
Expand Down
2 changes: 2 additions & 0 deletions fly.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@ kill_timeout = "5s"

[env]
PHX_HOST = "mave-metrics.internal"
DNS_CLUSTER_QUERY = "mave-metrics.internal"
PORT = "3000"
PRIMARY_REGION = "ams"
ROOT_URL = "http://mave-metrics.internal"
RELEASE_COOKIE = "3e0vnhSGgY-ZaVA4n3Djv5OCVpoiR4b2voHB2UvYrL4loe3av2XLQA=="

[[services]]
protocol = "tcp"
Expand Down
4 changes: 3 additions & 1 deletion lib/mave_metrics/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,14 @@ defmodule MaveMetrics.Application do
{Phoenix.PubSub, name: MaveMetrics.PubSub},
# Start Finch
{Finch, name: MaveMetrics.Finch},
# Start cluster
{DNSCluster, query: Application.get_env(:mave_metrics, :dns_cluster_query) || :ignore},
# Start the Endpoint (http/https)
MaveMetricsWeb.Endpoint,
# Start a worker by calling: MaveMetrics.Worker.start_link(arg)
# {MaveMetrics.Worker, arg}
# Start cache
MaveMetrics.PartitionedCache
MaveMetrics.PartitionedCache,
]

# See https://hexdocs.pm/elixir/Supervisor.html
Expand Down
2 changes: 1 addition & 1 deletion lib/mave_metrics/stats.ex
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ defmodule MaveMetrics.Stats do
nil ->
true

result ->
_result ->
false
end
end
Expand Down
34 changes: 20 additions & 14 deletions mix.exs
Original file line number Diff line number Diff line change
Expand Up @@ -33,34 +33,35 @@ defmodule MaveMetrics.MixProject do
# Type `mix help deps` for examples and options.
defp deps do
[
{:phoenix, "~> 1.7.0-rc.2", override: true},
{:phoenix, "~> 1.7"},
{:phoenix_ecto, "~> 4.4"},
{:ecto_sql, "~> 3.6"},
{:postgrex, ">= 0.0.0"},
{:ecto_sql, "~> 3.10"},
{:postgrex, "~> 0.17.3"},
{:phoenix_html, "~> 3.0"},
{:phoenix_live_reload, "~> 1.2", only: :dev},
{:phoenix_live_view, "~> 0.18.3"},
{:phoenix_live_reload, "~> 1.4", only: :dev},
{:phoenix_live_view, "~> 0.20.1"},
{:heroicons, "~> 0.5"},
{:floki, ">= 0.30.0", only: :test},
{:phoenix_live_dashboard, "~> 0.7.2"},
{:phoenix_live_dashboard, "~> 0.8.3"},
{:esbuild, "~> 0.5", runtime: Mix.env() == :dev},
{:tailwind, "~> 0.1.8", runtime: Mix.env() == :dev},
{:swoosh, "~> 1.3"},
{:finch, "~> 0.13"},
{:finch, "~> 0.16.0"},
{:telemetry_metrics, "~> 0.6"},
{:telemetry_poller, "~> 1.0"},
{:gettext, "~> 0.20"},
{:jason, "~> 1.2"},
{:plug_cowboy, "~> 2.5"},
{:timescale, "~> 0.0.1-alpha.5"},
{:jason, "~> 1.4"},
{:plug_cowboy, "~> 2.6"},
{:timescale, "~> 0.1.1"},
{:cors_plug, "~> 3.0"},
{:mix_test_watch, "~> 1.1", only: :dev, runtime: false},
{:morphix, "~> 0.8.1"},
{:ua_inspector, "~> 3.1"},
{:ua_inspector, "~> 3.6"},
{:redirect, "~> 0.4.0"},
{:nebulex, "~> 2.5"},
{:shards, "~> 1.0"},
{:decorator, "~> 1.4"}
{:shards, "~> 1.1"},
{:decorator, "~> 1.4"},
{:dns_cluster, "~> 0.1.1"}
]
end

Expand All @@ -77,7 +78,12 @@ defmodule MaveMetrics.MixProject do
"ecto.reset": ["ecto.drop", "ecto.setup"],
test: ["ecto.create --quiet", "ecto.migrate --quiet", "test"],
"assets.setup": ["tailwind.install --if-missing", "esbuild.install --if-missing"],
"assets.deploy": ["cmd npm install --prefix assets", "tailwind default --minify", "esbuild default --minify", "phx.digest"]
"assets.deploy": [
"cmd npm install --prefix assets",
"tailwind default --minify",
"esbuild default --minify",
"phx.digest"
]
]
end
end
Loading

0 comments on commit 674776b

Please sign in to comment.