Bump ranch listeners down accross the app..

This commit is contained in:
connor rigby 2017-11-27 08:10:01 -08:00
parent 8031bdce40
commit a2da261066
5 changed files with 9 additions and 4 deletions

View file

@ -33,13 +33,15 @@ for repo <- [Farmbot.Repo.A, Farmbot.Repo.B] do
config :farmbot, repo,
adapter: Sqlite.Ecto2,
loggers: [],
database: "tmp/#{repo}_dev.sqlite3"
database: "tmp/#{repo}_dev.sqlite3",
pool_size: 1
end
config :farmbot, Farmbot.System.ConfigStorage,
adapter: Sqlite.Ecto2,
loggers: [],
database: "tmp/#{Farmbot.System.ConfigStorage}_dev.sqlite3"
database: "tmp/#{Farmbot.System.ConfigStorage}_dev.sqlite3",
pool_size: 1
# Configure Farmbot Behaviours.
# Default Authorization behaviour.

View file

@ -45,7 +45,7 @@ defmodule Farmbot.BotState.Transport.HTTP do
{:ok, {_, _, body}} = :httpc.request(:get, {'#{s}/api/public_key', []}, [], [body_format: :binary])
public_key = body |> JOSE.JWK.from_pem
# FIXME(Connor) The router should probably be put in an externally supervised module..
case Plug.Adapters.Cowboy.http Router, [], [port: @port, dispatch: [cowboy_dispatch()]] do
case Plug.Adapters.Cowboy.http Router, [], [port: @port, acceptors: 2, dispatch: [cowboy_dispatch()]] do
{:ok, web} ->
state = %{web: web, bot_state: nil, sockets: [], public_key: public_key}
Process.link(state.web)

View file

@ -9,6 +9,7 @@ defmodule Farmbot.System.Debug do
def init([]) do
options = [
port: 5000,
acceptors: 3,
dispatch: [
{:_, [
{"/wobserver/ws", Wobserver.Web.Client, []},

View file

@ -12,6 +12,7 @@ defmodule Farmbot.Host.TargetConfiguratorTest.Supervisor do
Farmbot.Host.TargetConfiguratorTest,
[],
port: 4000,
acceptors: 3,
dispatch: [dispatch()]
)]
supervise(children, [strategy: :one_for_one])

View file

@ -60,7 +60,8 @@ defmodule Farmbot.Target.Bootstrap.Configurator do
:http,
Farmbot.Target.Bootstrap.Configurator.Router,
[],
port: 80
port: 80,
acceptors: 3
),
worker(Farmbot.Target.Bootstrap.Configurator.CaptivePortal, [])
]