Skip to content

Commit

Permalink
Start console monitor before socket, check for mix in OSS
Browse files Browse the repository at this point in the history
  • Loading branch information
vicmgs committed Apr 1, 2021
1 parent 4643b09 commit 0b1dad8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/console/application.ex
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ defmodule Console.Application do
# Start the Ecto repository
supervisor(Console.Repo, []),
# Start the endpoint when the application starts
worker(ConsoleWeb.Monitor, [%{}]),
supervisor(ConsoleWeb.Endpoint, []),
supervisor(Absinthe.Subscription, [ConsoleWeb.Endpoint]),
worker(ConsoleWeb.Monitor, [%{}]),
# Start your own worker by calling: Console.Worker.start_link(arg1, arg2, arg3)
# worker(Console.Worker, [arg1, arg2, arg3]),
{Task.Supervisor, name: ConsoleWeb.TaskSupervisor},
Expand Down
2 changes: 1 addition & 1 deletion lib/console_web/plug/rate_limit.ex
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ defmodule ConsoleWeb.Plug.RateLimit do
def call(conn, [action, limit]) do
ip_address = conn |> get_req_header("cf-connecting-ip") |> List.first()

if Mix.env == :test do
if Application.get_env(:console, :env) == :test do
conn
else
case Hammer.check_rate("#{action}:#{ip_address}", 60_000, limit) do
Expand Down

0 comments on commit 0b1dad8

Please sign in to comment.