Skip to content

Commit 880ade8

Browse files
committed
rel(CP): Don't run migrations
1 parent 7aad4b3 commit 880ade8

File tree

2 files changed

+7
-11
lines changed

2 files changed

+7
-11
lines changed

apps/cf_reverse_proxy/lib/plug.ex

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
defmodule CF.ReverseProxy.Plug do
22
@moduledoc false
33

4+
require Logger
45
use Plug.Builder
56

67
plug(
@@ -36,6 +37,8 @@ defmodule CF.ReverseProxy.Plug do
3637
path_info -> [path_info, CF.RestApi.Endpoint]
3738
end
3839

40+
Logger.info("Redirecting #{conn.host <> conn.request_path} to #{endpoint}")
41+
3942
conn
4043
|> Map.replace!(:path_info, path_info)
4144
|> Map.replace!(:request_path, Enum.join(path_info, "/"))
@@ -44,8 +47,9 @@ defmodule CF.ReverseProxy.Plug do
4447
else
4548
# Prod requests are routed through here
4649
def call(conn, _) do
47-
subdomain = get_domain_from_host(conn.host)
48-
endpoint = Map.get(@subdomains, subdomain, @default_host)
50+
service = get_domain_from_host(conn.host)
51+
endpoint = Map.get(@subdomains, service, @default_host)
52+
Logger.info("Redirecting #{conn.host <> conn.request_path} to #{endpoint}")
4953
endpoint.call(conn, endpoint.init(nil))
5054
end
5155

apps/db/lib/db/application.ex

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,7 @@ defmodule DB.Application do
1717
# See http://elixir-lang.org/docs/stable/elixir/Supervisor.html
1818
# for other strategies and supported options
1919
opts = [strategy: :one_for_one, name: DB.Supervisor]
20-
link = Supervisor.start_link(children, opts)
21-
migrate_db()
22-
link
23-
end
24-
25-
defp migrate_db do
26-
Logger.info("Running migrations...")
27-
Ecto.Migrator.run(DB.Repo, migrations_path(), :up, all: true)
28-
Logger.info("Migrated!")
20+
Supervisor.start_link(children, opts)
2921
end
3022

3123
defp migrations_path do

0 commit comments

Comments
 (0)