diff --git a/config/host/dev.exs b/config/host/dev.exs index c27d4527..407bb9e8 100644 --- a/config/host/dev.exs +++ b/config/host/dev.exs @@ -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. diff --git a/lib/farmbot/bot_state/transport/http/http.ex b/lib/farmbot/bot_state/transport/http/http.ex index f6eef129..a1e229d3 100644 --- a/lib/farmbot/bot_state/transport/http/http.ex +++ b/lib/farmbot/bot_state/transport/http/http.ex @@ -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) diff --git a/lib/farmbot/system/debug/debug.ex b/lib/farmbot/system/debug/debug.ex index f4f34b57..9ebc4b4b 100644 --- a/lib/farmbot/system/debug/debug.ex +++ b/lib/farmbot/system/debug/debug.ex @@ -9,6 +9,7 @@ defmodule Farmbot.System.Debug do def init([]) do options = [ port: 5000, + acceptors: 3, dispatch: [ {:_, [ {"/wobserver/ws", Wobserver.Web.Client, []}, diff --git a/nerves/host/bootstrap/target_configurator_test_supervisor.ex b/nerves/host/bootstrap/target_configurator_test_supervisor.ex index d48b5c63..a45a5ef7 100644 --- a/nerves/host/bootstrap/target_configurator_test_supervisor.ex +++ b/nerves/host/bootstrap/target_configurator_test_supervisor.ex @@ -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]) diff --git a/nerves/target/bootstrap/configurator/configurator.ex b/nerves/target/bootstrap/configurator/configurator.ex index 3663cad6..d3ee814b 100644 --- a/nerves/target/bootstrap/configurator/configurator.ex +++ b/nerves/target/bootstrap/configurator/configurator.ex @@ -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, []) ]